Heisenbug in GNUstep

Robert Millan rmh@debian.org
Mon, 20 Dec 2004 04:38:50 +0100


Hey.

I just played a bit with GNUstep.  It turns out that running almost any
application that is based on GNUstep results in weird coredumps here and
there.  I traced the problem untill it was isolated in a single program:

  gnustep-back-0.9.4/Tools/shared_obj/gpbs

which coredumps right after being run.  A gdb backtrace reported lots of calls
in libc and libstdc++ initialisation routines (libc has debugging symbols in
this one).  I thought that libstdc++ with debugging symbols could help, so
installed and.. voila!  The bug is gone.

So we have a genuine Heisenbug here..  I bet it's the same bug that breaks
nautilus, mozilla, emacs21 and a few others.  Anyone more clued than me could
have a look at the gdb backtrace pasted below and give some ideas on what to
try to beat this one?

GNU gdb 5.2.1 (FreeBSD)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
(no debugging symbols found)...
(gdb) r
Starting program: /home/rmh/tmp/gnustep/gnustep-back-0.9.4/Tools/shared_obj/gpbs 
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x2889d245 in next_env_entry (position=0xbfbfdc78) at arena.c:296
296	arena.c: No such file or directory.
	in arena.c
(gdb) bt
#0  0x2889d245 in next_env_entry (position=0xbfbfdc78) at arena.c:296
#1  0x2889d623 in ptmalloc_init () at arena.c:405
#2  0x2889dce0 in malloc_hook_ini (sz=3217022072, caller=0x28855abf)
    at hooks.c:43
#3  0x2889f166 in __libc_malloc (bytes=116) at malloc.c:3276
#4  0x28855abf in __newlocale (category_mask=8127, locale=0x28d3ca44 "C", 
    base=0x0) at newlocale.c:179
#5  0x28d17b1e in std::locale::facet::_S_create_c_locale(__locale_struct*&, char const*, __locale_struct*) () from /usr/lib/libstdc++.so.5
#6  0x28cf97fe in std::locale::_Impl::_Impl(std::locale::facet**, unsigned, bool) () from /usr/lib/libstdc++.so.5
#7  0x28cd9155 in std::locale::classic() () from /usr/lib/libstdc++.so.5
#8  0x28cd7b0d in std::locale::locale() () from /usr/lib/libstdc++.so.5
#9  0x28cc8247 in std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf() () from /usr/lib/libstdc++.so.5
#10 0x28cc6ee2 in std::ctype_byname<wchar_t>::ctype_byname(char const*, unsigned) () from /usr/lib/libstdc++.so.5
#11 0x28cd1021 in std::ios_base::Init::_S_ios_create(bool) ()
   from /usr/lib/libstdc++.so.5
#12 0x28cd1675 in std::ios_base::Init::Init() () from /usr/lib/libstdc++.so.5
#13 0x28cd0d98 in std::basic_iostream<wchar_t, std::char_traits<wchar_t> >::~basic_iostream() () from /usr/lib/libstdc++.so.5
#14 0x28cd0e0b in std::basic_iostream<wchar_t, std::char_traits<wchar_t> >::~basic_iostream() () from /usr/lib/libstdc++.so.5
#15 0x28d1fa05 in __cxa_dyn_string_eq () from /usr/lib/libstdc++.so.5
#16 0x28cc0a35 in _fini () from /usr/lib/libstdc++.so.5
#17 0x000099da in call_init () from /lib/ld.so.1
#18 0x00009b51 in _dl_init_internal () from /lib/ld.so.1
(gdb) q
The program is running.  Exit anyway? (y or n) 

-- 
 .''`.   Proudly running Debian GNU/kFreeBSD unstable/unreleased (on UFS2+S)
: :' :
`. `'    http://www.debian.org/ports/kfreebsd-gnu
  `-