Solaris 10: 'gmake check' dumps core

John W. Eaton jwe at bevo.che.wisc.edu
Mon Aug 4 21:21:10 CDT 2008


On  4-Aug-2008, Ole Tange wrote:

| Program received signal SIGSEGV, Segmentation fault.
| 0xfd5a5c01 in std::string::find () from /opt/csw/lib/libstdc++.so.6
| (gdb) bt
| #0  0xfd5a5c01 in std::string::find () from /opt/csw/lib/libstdc++.so.6
| #1  0xfd907471 in file_ops::is_dir_sep (c=47 '/') at file-ops.cc:857
| #2  0xfd90c7f2 in file_ops::concat (dir=@0x8047980, file=@0x8047990)
|     at /opt/csw/gcc3/lib/gcc/i386-pc-solaris2.8/3.4.5/../../../../include/c++/3.4.5/bits/basic_string.h:541
| #3  0xfe4b842a in __static_initialization_and_destruction_0
| (__initialize_p=1, __priority=0)
|     at /opt/csw/gcc3/lib/gcc/i386-pc-solaris2.8/3.4.5/../../../../include/c++/3.4.5/ext/new_allocator.h:62
| #4  0xfe842d0d in __do_global_ctors_aux ()
|     at /opt/csw/gcc3/lib/gcc/i386-pc-solaris2.8/3.4.5/../../../../include/c++/3.4.5/bits/list.tcc:69
| #5  0xfe842d22 in _init () at
| /opt/csw/gcc3/lib/gcc/i386-pc-solaris2.8/3.4.5/../../../../include/c++/3.4.5/bits/list.tcc:69
| #6  0xfefd58fc in call_init () from /lib/ld.so.1
| #7  0xfefd5681 in is_dep_init () from /lib/ld.so.1
| #8  0xfefdf7c5 in elf_bndr () from /lib/ld.so.1
| #9  0xfefcc1d4 in elf_rtbndr () from /lib/ld.so.1
| #10 0xfefb0460 in ?? ()
| #11 0x00000d98 in ?? ()
| #12 0xfd931758 in __static_initialization_and_destruction_0
| (__initialize_p=-17103776, __priority=1) at DiagArray2.h:115
| #13 0xfdc64531 in __do_global_ctors_aux ()
|     at /opt/csw/gcc3/lib/gcc/i386-pc-solaris2.8/3.4.5/../../../../include/c++/3.4.5/bits/stl_construct.h:106
| #14 0xfdc64546 in _init () at
| /opt/csw/gcc3/lib/gcc/i386-pc-solaris2.8/3.4.5/../../../../include/c++/3.4.5/bits/stl_construct.h:106
| #15 0xfefd58fc in call_init () from /lib/ld.so.1
| #16 0xfefd4fcc in setup () from /lib/ld.so.1
| #17 0xfefe0734 in _setup () from /lib/ld.so.1
| #18 0xfefcc0b8 in _rt_boot () from /lib/ld.so.1
| #19 0x08047d5c in ?? ()
| #20 0xfeffab18 in _GLOBAL_OFFSET_TABLE_ () from /lib/ld.so.1
| #21 0x00000003 in ?? ()
| #22 0x08047da0 in ?? ()
| #23 0x00000004 in ?? ()
| #24 0x08047da8 in ?? ()
| #25 0x00000005 in ?? ()
| #26 0x08047df0 in ?? ()
| #27 0x00000000 in ?? ()
| (gdb) frame 2
| #2  0xfd90c7f2 in file_ops::concat (dir=@0x8047980, file=@0x8047990)
|     at /opt/csw/gcc3/lib/gcc/i386-pc-solaris2.8/3.4.5/../../../../include/c++/3.4.5/bits/basic_string.h:541
| 541           length() const { return _M_rep()->_M_length; }
| Current language:  auto; currently c++
| (gdb) info args
| dir = (const string &) @0x8047980: {static npos = 4294967295,
|   _M_dataplus = {<std::allocator<char>> =
| {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data
| fields>},
|     _M_p = 0x8060a6c "/"}}
| file = (const string &) @0x8047990: {static npos = 4294967295,
|   _M_dataplus = {<std::allocator<char>> =
| {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data
| fields>},
|     _M_p = 0x806188c ".octave_hist"}}
| (gdb)

This crash appears to be happening before main is even called, when
static variables are being initialized.  The function
file_ops::is_dir_sep is just

  bool
  file_ops::is_dir_sep (char c)
  {
    return dir_sep_chars.find (c) != NPOS;
  }

but it relies on having the static variable file_ops::dir_sep_chars
defined before it is called.  Apparently that is not happening here.
I suppose the quick fix is to modify this function to be

  bool
  file_ops::is_dir_sep (char c)
  {
  #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM)
    static std::string xdir_sep_chars ("/\\");
  #else
    static std::string xdir_sep_chars (file_ops::dir_sep_str);
  #endif
    return xdir_sep_chars.find (c) != NPOS;
  }

Perhaps I can install a better fix in the current development sources,
but I can't think of anything that wouldn't break binary
compatibility, so this workaround is probably the best thing for the
3.0.x series.

jwe


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080804/4e94e8aa/attachment.ksh 


More information about the Bug-octave mailing list