Solaris 10: 'gmake check' dumps core

Jaroslav Hajek highegg at gmail.com
Tue Aug 5 02:47:07 CDT 2008


On Tue, Aug 5, 2008 at 4:21 AM, John W. Eaton <jwe at bevo.che.wisc.edu> wrote:
> 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.
>

Applied.


> jwe
>
>
>
> # HG changeset patch
> # User John W. Eaton <jwe at octave.org>
> # Date 1217902534 14400
> # Node ID c0d7eb6623840fed1de9c8015298cebfbe5e9887
> # Parent  4363bc94171ac18fa0ce5ccf6a7550712b9c1ca4
> run-octave.in: use sed to append : to path elements
>
> diff --git a/ChangeLog b/ChangeLog
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,4 +1,9 @@
>  2008-08-04  John W. Eaton  <jwe at octave.org>
> +
> +       * Makeconf.in (do-subst-script-vals): Also substitute SED.
> +       * run-octave.in: Use sed to append : to path elements
> +       instead of using the find expression "-exec echo '{}':".
> +       Substitute SED here.
>
>        * aclocal.m4: Fail if no usable version of sed is found.
>
> diff --git a/Makeconf.in b/Makeconf.in
> --- a/Makeconf.in
> +++ b/Makeconf.in
> @@ -600,6 +600,7 @@
>  $(SED) < $< \
>   -e "s|%AWK%|${AWK}|g" \
>   -e "s|%FIND%|${FIND}|g" \
> +  -e "s|%SED%|${SED}|g" \
>   -e "s|%library_path_var%|${library_path_var}|g" \
>   -e "s|%liboctinterp%|${LIBPRE}octinterp.${SHLEXT}|g" \
>   -e "s|%liboctave%|${LIBPRE}octave.${SHLEXT}|g" \
> diff --git a/run-octave.in b/run-octave.in
> --- a/run-octave.in
> +++ b/run-octave.in
> @@ -22,6 +22,7 @@
>
>  AWK=%AWK%
>  FIND=%FIND%
> +SED=%SED%
>
>  # FIXME -- is there a better way to handle the possibility of spaces
>  # in these names?
> @@ -38,10 +39,10 @@
>  d3="$builddir/scripts"
>  d4="$builddir/src"
>
> -d1_list=`$FIND "$d1" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'`
> -d2_list=`$FIND "$d2" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'`
> -d3_list=`$FIND "$d3" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'`
> -d4_list=`$FIND "$d4" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'`
> +d1_list=`$FIND "$d1" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'`
> +d2_list=`$FIND "$d2" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'`
> +d3_list=`$FIND "$d3" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'`
> +d4_list=`$FIND "$d4" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'`
>
>  d1_path=`echo "$d1_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'`
>  d2_path=`echo "$d2_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'`
>
> _______________________________________________
> Bug-octave mailing list
> Bug-octave at octave.org
> https://www.cae.wisc.edu/mailman/listinfo/bug-octave
>
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


More information about the Bug-octave mailing list