Subject: Re: core dumps in XF4
To: None <port-i386@netbsd.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: port-i386
Date: 11/29/2001 19:26:14
On Tue, Nov 27, 2001 at 04:30:23PM +0000, Patrick Welche wrote:
> For some reason, since building a Nov 22 21:14GMT source world, I get core
> dumps from XF4 programs segfaulting eg:
> iceauth:
> #0  0x480637f1 in IceUnlockAuthFile () from /usr/X11R6/lib/libICE.so.6
> smproxy:
> #0  0x4821fdcc in strcmp () from /usr/lib/libc.so.12
> twm:
> #0  0x4823bdcc in strcmp () from /usr/lib/libc.so.12
> 
> Have any of you seen this, or do you think this is the Mysterious Signal 11
> Problem (nought to do with the code)? (Mozilla compiled from pkgsrc runs
> apart from not being able to read configuration files - possibly also
> involving strcmp? strcmp.c hasn't changed in years!)

I need a lesson in debugging.. Story so far:
- Nov 27 src, Nov 28 xsrc USE_XF86_4=yes
- log in to xdm
- get SEGV from iceauth, smproxy, xclock, twm
- if the xterm appears, running twm just generates the same core dump
- if I move to a wscons screen, twm -display :0& works just fine
- core dump for eg. twm/smproxy is as above, so I rebuilt both libc.so.12.80
  and smproxy with -g expecting more informative errors, but:
#0  0x4821fe0c in strcmp () from /usr/lib/libc.so.12
#1  0x480c5e1d in _IceGetPoValidAuthIndices () from /usr/X11R6/lib/libICE.so.6
#2  0x480c425c in IceOpenConnection () from /usr/X11R6/lib/libICE.so.6
#3  0x480b90a8 in SmcOpenConnection () from /usr/X11R6/lib/libSM.so.6
#4  0x804a657 in ConnectProxyToSM (previous_id=0x0) at smproxy.c:1180
#5  0x804a869 in main (argc=1, argv=0xbfbfd79c) at smproxy.c:1303
- rebuilt libc.a with -g, and linked smproxy statically. Still no symbols
  are shown...
Program terminated with signal 11, Segmentation fault.
#0  0x80f1b64 in strcmp ()
- Strange thing:
    addr2line -e /usr/xsrc/xfree/xc/programs/smproxy/smproxy 0x80f1b64
    /usr/src/lib/libc/stdlib/qsort.c:189
  Not strcmp at all ?!

So, why would a program run from within in xterm, and the same program run from
a console window act differently? Is my gdb up the creek?

Cheers,

Patrick