octave-maintainers
[Top][All Lists]
Advanced

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

Bus-error


From: John W. Eaton
Subject: Bus-error
Date: Thu, 30 Sep 2010 13:32:53 -0400

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.

| 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 octave.cc:

  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


reply via email to

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