octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bus-error


From: bpabbott
Subject: Re: Bus-error
Date: Thu, 30 Sep 2010 19:08:12 +0000 (GMT)

On Sep 30, 2010, at 01:32 PM, "John W. Eaton" <address@hidden> wrote:

On 30-Sep-2010, bpabbott wrote:

| My tip is
|
| changeset: 11074:e678346a47d9
| tag: tip
| user: John W. Eaton <address@hidden>
| date: Thu Sep 30 06:00:00 2010 -0400
| summary: toplev.cc, sighandlers.cc, utils.cc, octave.cc, pt-eval.cc
| pt-idx.cc: Octave_map to octave_map and octave_scalar_map conversion
|
| Building the docs results in a bus-error.

I can't seem to reproduce the problem here.
 
I confirmed the problem on a second Mac box, and also confirmed there is no problem for Ubuntu 10.0.

| From gdb ..
|
| ../../run-octave -g -f -q -H ./mk_doc_cache.m doc-cache ../../scripts/
| DOCSTRINGS ../../src/DOCSTRINGS || { rm -f doc-cache; exit 1; }
|
| octave(32194,0xa07db500) malloc: *** error for object 0xe48f78: pointer being
| freed was not allocated
| *** set a breakpoint in malloc_error_break to debug
| error: octave_map::setfield: internal error
| error: octave_map::setfield: internal error
| octave(32194,0xa07db500) malloc: *** error for object 0xe48f78: pointer being
| freed was not allocated
| *** set a breakpoint in malloc_error_break to debug
|
| Program received signal EXC_BAD_ACCESS, Could not access memory.
| Reason: KERN_PROTECTION_FAILURE at address: 0x00000004
| 0x0008a84a in Array<octave_value>::resize (this=0x0, r=1, c=1, address@hidden)
| at Array.cc:968
| 968 if (r >= 0 && c >= 0 && ndims () == 2)
| (gdb) bt
| #0 0x0008a84a in Array<octave_value>::resize (this=0x0, r=1, c=1, rfv=
| @0xe46720) at Array.cc:968
| #1 0x0008aa88 in Array<octave_value>::resize (this=0x0, address@hidden, rfv=
| @0xe46720) at Array.cc:1012
| #2 0x00302e55 in octave_map::resize (this=0xe47680, address@hidden, fill=
| false) at oct-map.cc:565
| #3 0x003a5f2a in F__version_info__ (address@hidden) at octave.cc:247

OK, the crash is happening in oct-map.cc, here:

void
octave_map::resize (const dim_vector& dv, bool fill)
{
octave_idx_type nf = nfields ();
if (nf > 0)
{
for (octave_idx_type i = 0; i < nf; i++)
{
if (fill)
xvals[i].resize (dv, Cell::resize_fill_value ());
else
xvals[i].resize (dv); <<< line 565 <<<
}
}

called from F__version_info__ in octavecc:

static octave_map vinfo;

...

else
{
octave_idx_type n = vinfo.numel () + 1;

vinfo.resize (dim_vector (n, 1)); <<< line 247 <<<

I'd guess the loop index i is out of range and xvals[i] is not valid.
But I don't know why that would be happening, or why this call to
resize should not be OK. Maybe Jaroslav can comment?

Until then, does the following change fix the problem for you?

diff --git a/src/octave.cc b/src/octave.cc
--- a/src/octave.cc
+++ b/src/octave.cc
@@ -227,7 +227,7 @@
{
octave_value retval;

- static octave_map vinfo;
+ static Octave_map vinfo;

int nargin = args.length ();

jwe

With that change I still have a problem.

../../run-octave -f -q -H ./mk_doc_cache.m doc-cache ../../scripts/DOCSTRINGS ../../src/DOCSTRINGS || { rm -f doc-cache; exit 1; }
octave(54771,0xa07db500) malloc: *** error for object 0xe48fb8: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
error: octave_map::setfield: internal error
error: octave_map::setfield: internal error
octave(54771,0xa07db500) malloc: *** error for object 0xe48fb8: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

panic: Segmentation fault -- stopping myself...
attempting to save variables to `octave-core'...
panic: attempted clean up apparently failed -- aborting...
/bin/sh: line 1: 54771 Abort trap              ../../run-octave -f -q -H ./mk_doc_cache.m doc-cache ../../scripts/DOCSTRINGS ../../src/DOCSTRINGS
make[3]: *** [doc-cache] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

From the debugger …

../../run-octave -g -f -q -H ./mk_doc_cache.m doc-cache ../../scripts/DOCSTRINGS ../../src/DOCSTRINGS || { rm -f doc-cache; exit 1; }
(gdb) run
Starting program: /Users/bpabbott ... SNIP ...
Reading symbols for shared libraries .++++++++++++++++++++.............................................................................................. done
octave(55300,0xa07db500) malloc: *** error for object 0xe48fb8: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
error: octave_map::setfield: internal error
error: octave_map::setfield: internal error
octave(55300,0xa07db500) malloc: *** error for object 0xe48fb8: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug


Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x62786580
std::_Rb_tree<std::string, std::pair<std::string const, int>, std::_Select1st<std::pair<std::string const, int> >, std::less<std::string>, std::allocator<std::pair<std::string const, int> > >::_M_erase (this=0xe48fb8, __x=0x62786574) at stl_tree.h:1325
1325  _M_erase(_S_right(__x));
(gdb) bt
#0  std::_Rb_tree<std::string, std::pair<std::string const, int>, std::_Select1st<std::pair<std::string const, int> >, std::less<std::string>, std::allocator<std::pair<std::string const, int> > >::_M_erase (this=0xe48fb8, __x=0x62786574) at stl_tree.h:1325
#1  0x00005557 in std::_Rb_tree<std::string, std::pair<std::string const, int>, std::_Select1st<std::pair<std::string const, int> >, std::less<std::string>, std::allocator<std::pair<std::string const, int> > >::_S_left () at /usr/include/c++/4.2.1/bits/stl_tree.h:1325
#2  0x00005557 in std::_Rb_tree<std::string, std::pair<std::string const, int>, std::_Select1st<std::pair<std::string const, int> >, std::less<std::string>, std::allocator<std::pair<std::string const, int> > >::_M_erase (this=0xe48fb8, __x=0x4800780) at stl_tree.h:1325
#3  0x00b027fd in ~_Rb_tree [inlined] () at /usr/include/c++/4.2.1/bits/stl_tree.h:594
#4  0x00b027fd in ~map [inlined] () at /usr/include/c++/4.2.1/bits/stl_map.h:594
#5  0x00b027fd in ~_Rb_tree [inlined] () at stl_tree.h:41
#6  0x00b027fd in ~fields_rep [inlined] () at stl_tree.h:94
#7  0x00b027fd in ~fields_rep [inlined] () at /Users/bpabbott/Development/mercurial/local_clone/src/oct-map.h:41
#8  0x00b027fd in __tcf_6 () at stl_tree.h:1325
#9  0x96a011bf in __cxa_finalize ()
#10 0x96a010d4 in exit ()
#11 0x00411996 in clean_up_and_exit (retval=1) at toplev.cc:676
#12 0x003ac583 in octave_main (argc=13, argv=0xbfffaef4, embedded=0) at octave.cc:848
#13 0x00001f80 in main (argc=13, argv=0xbfffaef4) at main.c:35
Current language:  auto; currently c++

Ben


reply via email to

[Prev in Thread] Current Thread [Next in Thread]