[Pkg-octave-devel] octave-3.0.0 crashes at startup on ARM

John W. Eaton jwe at bevo.che.wisc.edu
Tue Jan 29 03:16:32 CST 2008


On 28-Jan-2008, Rafael Laboissiere wrote:

| * John W. Eaton <jwe at bevo.che.wisc.edu> [2008-01-10 09:53]:
| 
| > The last bits of this execution path are apparently
| > 
| >   octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| > 
| > (line 52 in oct-shlib.h) which is calling make_shlib from
| > oct-shlib.cc:
| > 
| >   octave_shlib *
| >   octave_shlib::make_shlib (void)
| >   {
| >   #if defined (HAVE_DLOPEN_API)
| >     return new octave_dlopen_shlib ();
| >   #elif defined (HAVE_SHL_LOAD_API)
| >     return new octave_shl_load_shlib ();
| >   #elif defined (HAVE_LOADLIBRARY_API)
| >     return new octave_w32_shlib ();
| >   #elif defined (HAVE_DYLD_API)
| >     return new octave_dyld_shlib ();
| >   #else
| >     return new octave_base_shlib ();
| >   #endif
| >   }
| > 
| > >From the info above, it's not clear precisely which line is causing
| > the crash, but according to the build log linked here:
| > 
| > | Build logs of crashing build can be found at
| > | http://buildd.debian.org/fetch.cgi?pkg=octave3.0;ver=3.0.0-1;arch=arm;stamp=1199146040
| > 
| > it seems that HAVE_DLOPEN_API is defined, so it should be executing
| > 
| >   return new octave_dlopen_shlib ()
| > 
| > [snip]
| 
| Thomas and I are running an ARM emulation under qemu and we could not get
| that far using gdb.  The gdb log is attached below.  I set a breakpoint at
| octave_dynamic_loader::do_load_oct and then step until the line 324 of
| dynamic-ld.cc ("octave_shlib oct_file;").  I then use stepi to try to catch
| where the segmentation fault occurs but I cannot even enter
| octave_shlib::make_shlib().
| 
| Would you have any ideas on how to pursue this?
| 
| -- 
| Rafael
| $ ./run-octave -g
| GNU gdb 6.7.1-debian
| Copyright (C) 2007 Free Software Foundation, Inc.
| License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
| This is free software: you are free to change and redistribute it.
| There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
| and "show warranty" for details.
| This GDB was configured as "arm-linux-gnu"...
| Using host libthread_db library "/lib/libthread_db.so.1".
| (gdb) run
| Starting program: [...]
| [Thread debugging using libthread_db enabled]
| [New Thread 0x40020ef0 (LWP 3657)]
| GNU Octave, version 3.0.0
| Copyright (C) 2007 John W. Eaton and others.
| This is free software; see the source code for copying conditions.
| There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
| FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
| 
| Octave was configured for "armv5tejl-unknown-linux-gnu".
| 
| Additional information about Octave is available at http://www.octave.org.
| 
| Please contribute if you find this software useful.
| For more information, visit http://www.octave.org/help-wanted.html
| 
| Report bugs to <bug at octave.org> (but first, please read
| http://www.octave.org/bugs.html to learn how to write a helpful report).
| 
| For information about changes from previous versions, type `news'.
| 
| octave:1> [ctrl-z]
| Program received signal SIGTSTP, Stopped (user).
| [Switching to Thread 0x40020ef0 (LWP 3657)]
| 0x422c3dd4 in read () from /lib/libc.so.6
| (gdb) break octave_dynamic_loader::do_load_oct
| Breakpoint 1 at 0x402b68e4: file dynamic-ld.cc, line 322.
| (gdb) c
| Continuing.
| 
| Program received signal SIGTSTP, Stopped (user).
| 0x4223a81c in sigprocmask () from /lib/libc.so.6
| (gdb) c
| Continuing.
| 
| Program received signal SIGTSTP, Stopped (user).
| 0x4223a81c in sigprocmask () from /lib/libc.so.6
| (gdb) c
| Continuing.
| 
| octave:1> det(1)
| 
| Breakpoint 1, octave_dynamic_loader::do_load_oct (this=0xf59338,
|     fcn_name=@0xbe96e018, file_name=@0xbe96e014, relative=false)
|     at dynamic-ld.cc:322
| 322       bool retval = false;
| Current language:  auto; currently c++
| (gdb) s
| 324       octave_shlib oct_file;
| (gdb) s
| octave_shlib (this=0xbe96dea0) at ../liboctave/oct-shlib.h:52
| 52        octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| (gdb) stepi
| 0x402b7e9c      52        octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| (gdb) stepi
| 0x402b7ea0      52        octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| (gdb) stepi
| 0x402b7ea4      52        octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| (gdb) stepi
| 0x402b7ea8      52        octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| (gdb) stepi
| 0x402b7eac      52        octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| (gdb) stepi
| 0x402b7eb0      52        octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| (gdb) stepi
| 0x402b7eb4      52        octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| (gdb) stepi
| 0x402b7eb8      52        octave_shlib (void) : relative (false), rep (make_shlib ()) { }
| (gdb) stepi
| 0x401f5510 in ?? ()
|    from /usr/local/src/octave/mit-debug-ohne-optimierung/octave-3.0.0/src/liboctinterp.so
| (gdb) stepi
| 0x401f5514 in ?? ()
|    from /usr/local/src/octave/mit-debug-ohne-optimierung/octave-3.0.0/src/liboctinterp.so
| (gdb) stepi
| 0x401f5518 in ?? ()
|    from /usr/local/src/octave/mit-debug-ohne-optimierung/octave-3.0.0/src/liboctinterp.so
| (gdb) stepi
| octave_shlib::make_shlib () at oct-shlib.cc:681
| 681     octave_shlib::make_shlib (void)
| (gdb) stepi
| 0x40f65870      681     octave_shlib::make_shlib (void)
| (gdb) stepi
| 0x40f65874      681     octave_shlib::make_shlib (void)
| (gdb) stepi
| 0x40f65878      681     octave_shlib::make_shlib (void)
| (gdb) stepi
| 0x40f6587c      681     octave_shlib::make_shlib (void)
| (gdb) stepi
| 0x40f65880      681     octave_shlib::make_shlib (void)
| (gdb) stepi
| 0x40f65884      681     octave_shlib::make_shlib (void)
| (gdb) stepi
| 0x40f65888      681     octave_shlib::make_shlib (void)
| (gdb) stepi
| 
| Program received signal SIGSEGV, Segmentation fault.
| 0x40f65888 in octave_shlib::make_shlib () at oct-shlib.cc:681
| 681     octave_shlib::make_shlib (void)
| (gdb) bt
| #0  0x40f65888 in octave_shlib::make_shlib () at oct-shlib.cc:681
| #1  0x402b7ebc in octave_shlib (this=0xbe96dea0) at ../liboctave/oct-shlib.h:52
| #2  0x402b6914 in octave_dynamic_loader::do_load_oct (this=0xf59338,
|     fcn_name=@0xbe96e018, file_name=@0xbe96e014, relative=false)
|     at dynamic-ld.cc:324
| #3  0x402b7118 in octave_dynamic_loader::load_oct (fcn_name=@0xbe96e018,
|     file_name=@0xbe96e014, relative=false) at dynamic-ld.cc:508
| #4  0x4056eadc in load_fcn_from_file (nm_arg=@0xbe96e110, exec_script=false)
|     at parse.y:3440
| #5  0x4056f0c8 in load_fcn_from_file (sym_rec=0xf912e0, exec_script=false)
|     at parse.y:3480
| #6  0x4061c01c in lookup (sym_rec=0xf912e0, exec_script=false)
|     at variables.cc:1118
| #7  0x4061c230 in is_valid_function (fcn_name=@0xf84584, warn_for=@0xbe96e2e0,
|     warn=true) at variables.cc:483
| #8  0x42699bf0 in builtin (base=@0xf84584) at ./DLD-FUNCTIONS/dispatch.cc:214
| #9  0x4269ae5c in octave_dispatch::do_multi_index_op (this=0xf84558,
|     nargout=0, args=@0xf62e30) at ./DLD-FUNCTIONS/dispatch.cc:272
| #10 0x4269b210 in octave_dispatch::subsref (this=0xf84558, type=@0xf57fe4,
|     idx=@0xbe96e7d4, nargout=0) at ./DLD-FUNCTIONS/dispatch.cc:145
| #11 0x406c38b8 in octave_value::subsref (this=0xbe96e7e0, type=@0xf57fe4,
|     idx=@0xbe96e7d4, nargout=0) at ov.cc:783
| #12 0x408ad260 in tree_index_expression::rvalue (this=0xf57fc0, nargout=0)
|     at pt-idx.cc:352
| #13 0x408e29f8 in tree_statement::eval (this=0xf62e58, silent=false,
|     nargout=0, in_function_body=false) at pt-stmt.cc:133
| #14 0x408e2f24 in tree_statement_list::eval (this=0x1492710, silent=false,
|     nargout=0) at pt-stmt.cc:190
| #15 0x405fd178 in main_loop () at toplev.cc:225
| #16 0x40548e90 in octave_main (argc=5, argv=0xbe96ee94, embedded=0)
|     at octave.cc:835
| #17 0x000086c8 in main (argc=5, argv=0xbe96ee94) at main.c:35

I have no clues left.  I used them all up in my last message about
this topic.

If I were desperate, I would try crazy things like rearranging the
source a bit, say changing

  octave_shlib (void) : relative (false), rep (make_shlib ()) { }

  octave_shlib (const std::string& f)
    : relative (false), rep (make_shlib ()) { open (f); }

to

  octave_shlib (void) : relative (false), rep (0)
  {
    rep = make_shlib ();
  }

  octave_shlib (const std::string& f) : relative (false), rep (0)
  {
    rep = make_shlib ();
    open (f);
  }

to see if that helped with debugging.  But given that this
architecture is slow and you are having to run it in an emulator, it
sounds like that could be quite time consuming, and it is more or less
debugging by (nearly) random guessing.

Can you just drop this architecture as a requirement for getting
Octave into the testing distribution?  Or is it m68k all over again?

jwe


More information about the Bug-octave mailing list