Bug 105803

Summary: NPTL - deadlock at run-time
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Michael Meeks <mmeeks>
Component: KernelAssignee: Andrea Arcangeli <andrea>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Beta 2   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: gdb log
a 2nd log ...

Description Michael Meeks 2005-08-19 11:26:22 UTC
I saw this with OO.o on B1 - which was painful, seems to work for OO.o now, but
nasties with nautilus:

gdb nautilus
r
Program received signal SIG33, Real-time event 33.
[Switching to Thread 1138224048 (LWP 10439)]
0xffffe410 in __kernel_vsyscall ()
(gdb) c
Continuing.

Program received signal SIG33, Real-time event 33.
[Switching to Thread 1140476848 (LWP 10443)]
0x411a10f8 in clone () from /lib/tls/libc.so.6
(gdb) c
Continuing.

the signals seem to be coming from NPTL stuff, worse - I get a deadlock pretty
quickly in (eg.):

Thread 1 (Thread 1092843168 (LWP 10436)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0x40ed7b90 in __nptl_setxid () from /lib/tls/libpthread.so.0
#2  0x41199a4f in setegid () from /lib/tls/libc.so.6
#3  0x40ad31a0 in gnome_vfs_method_init ()

Thread 3 (Thread 1140476848 (LWP 10443)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0x40edd11e in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0
#2  0x40ed9e15 in _L_mutex_lock_36 () from /lib/tls/libpthread.so.0
#3  0x413c8fcc in ?? () from /opt/gnome/lib/gnome-vfs-2.0/modules/libfile.so
#4  0x40f681a4 in ?? () from /opt/gnome/lib/libglib-2.0.so.0
#5  0x40ed9cd0 in pthread_mutex_destroy () from /lib/tls/libpthread.so.0
#6  0x40f2b7aa in g_static_rec_mutex_lock ()

doesn't look good.
Comment 1 Andreas Schwab 2005-08-19 12:50:42 UTC
Make sure that /lib/tls/libpthread.so.0 is not stripped. 
Comment 2 Michael Meeks 2005-08-19 13:43:11 UTC
michael@linux:~> cp /lib/tls/libpthread.so.0 ~
michael@linux:~> cp libpthread.so.0 foo.so.0
michael@linux:~> strip foo.so.0
michael@linux:~> ls -l *.0
-rwxr-xr-x  1 michael users 67672 2005-08-19 14:48 foo.so.0
-rwxr-xr-x  1 michael users 93266 2005-08-19 14:48 libpthread.so.0

objdump -x shows lots of helpful looking symbols too - so - prolly not that.
Comment 3 Andreas Schwab 2005-08-19 13:53:50 UTC
Attach the *complete* gdb session with debug lin-lwp set. 
Comment 4 Michael Meeks 2005-08-19 14:20:22 UTC
I attach 2 logs:
Comment 5 Michael Meeks 2005-08-19 14:21:20 UTC
Created attachment 46700 [details]
gdb log 

In this case I tried 'bt' when I got this expected & unwanted signal
(presumably from the NPTL/kernel bits) - the 2nd time it bombed & killed gdb
with a giant 0 stack-trace.
Comment 6 Marcus Meissner 2005-08-19 14:23:52 UTC
for the SIG33 do 
 
handle SIG33 pass noprint nostop 
 
this will remove them from your view in gdb ;) 
Comment 7 Michael Meeks 2005-08-19 14:25:40 UTC
Created attachment 46701 [details]
a 2nd log ...

This time I just did 'continue' on these signals - until it deadlocked, then
got ctrl-c & 't a a bt'
HTH.
Comment 8 Michael Meeks 2005-08-19 14:34:42 UTC
Marcus - thanks for the tip - helpful. However, surely you're not suggesting
every user of gdb against a threaded app, forever more is going to have to type
'handle SIG33 pass noprint nostop' before having a useful debugger ? :-) is that
not something we need to build into gdb ?
Comment 9 Andreas Schwab 2005-08-19 14:35:26 UTC
Output of info sharedlibrary. 
Comment 10 Michael Meeks 2005-08-19 14:59:21 UTC
(gdb) info sharedlibrary
From        To          Syms Read   Shared Object Library
0x4004f650  0x400b7968  Yes         /opt/gnome/lib/libnautilus-private.so.2
0x401152f0  0x4011d4b8  Yes         /usr/lib/libbeagle.so.0
0x40122ac0  0x40125658  Yes         /opt/gnome/lib/libnautilus-extension.so.1
0x40143cc0  0x4019c9b8  Yes         /opt/gnome/lib/libeel-2.so.2
0x401b7720  0x401c4748  Yes         /opt/gnome/lib/libgnome-menu.so.2
0x401cb390  0x401cec48  Yes         /opt/gnome/lib/libgailutil.so.17
0x401d7170  0x401e4ce8  Yes         /opt/gnome/lib/libglade-2.0.so.0
0x401f06a0  0x40216cd8  Yes         /opt/gnome/lib/librsvg-2.so.2
0x40222f90  0x4023bc78  Yes         /opt/gnome/lib/libgsf-1.so.1
0x402450e0  0x40253e98  Yes         /lib/libbz2.so.1
0x4025e100  0x4027ee18  Yes         /opt/gnome/lib/libcroco-0.6.so.3
0x40291380  0x4029cd88  Yes         /opt/gnome/lib/libgnome-desktop-2.so.2
0x402b9d70  0x40305dd8  Yes         /opt/gnome/lib/libgnomeui-2.so.0
0x4032c360  0x403327f8  Yes         /opt/gnome/lib/libgnome-keyring.so.0
0x40336380  0x40350bd8  Yes         /usr/lib/libjpeg.so.62
0x4036a460  0x403a41a8  Yes         /opt/gnome/lib/libbonoboui-2.so.0
0x403ba3c0  0x403d7bb8  Yes         /opt/gnome/lib/libgnomecanvas-2.so.0
0x403e2500  0x403ed068  Yes         /opt/gnome/lib/libgnome-2.so.0
0x403f2970  0x403f7c28  Yes         /usr/lib/libesd.so.0
0x4041a280  0x4049f5c8  Yes         /usr/lib/libasound.so.2
0x404b8e70  0x404ba6b8  Yes         /lib/libresmgr.so.1
0x404bf290  0x404d8b68  Yes         /usr/lib/libaudiofile.so.0
0x404e1310  0x404f4358  Yes         /usr/lib/libart_lgpl_2.so.2
0x40540910  0x4076d078  Yes         /opt/gnome/lib/libgtk-x11-2.0.so.0
0x40833f40  0x40886f78  Yes         /opt/gnome/lib/libgdk-x11-2.0.so.0
0x408b3320  0x408bf318  Yes         /opt/gnome/lib/libatk-1.0.so.0
0x408c8660  0x408d71b8  Yes         /opt/gnome/lib/libgdk_pixbuf-2.0.so.0
0x408de240  0x408e1178  Yes         /opt/gnome/lib/libpangoxft-1.0.so.0
0x408e5310  0x408e7bb8  Yes         /opt/gnome/lib/libpangocairo-1.0.so.0
0x408ec940  0x408f2298  Yes         /opt/gnome/lib/libpangox-1.0.so.0
0x408f95c0  0x40917998  Yes         /opt/gnome/lib/libpangoft2-1.0.so.0
0x4091fec0  0x409429e8  Yes         /usr/lib/libcairo.so.1
0x4094e920  0x4096ae38  Yes         /opt/gnome/lib/libpango-1.0.so.0
0x40986050  0x4099d5f8  Yes         /usr/lib/libfontconfig.so.1
0x409b2d70  0x40a05568  Yes         /usr/lib/libfreetype.so.6
0x40a1c100  0x40a323c8  Yes         /usr/lib/libexpat.so.0
0x40a3b700  0x40a4ed68  Yes         /usr/lib/libpixman.so.1
0x40a53350  0x40a589a8  Yes         /usr/X11R6/lib/libXrender.so.1
0x40a5c690  0x40a666e8  Yes         /usr/X11R6/lib/libXext.so.6
0x40a6dc80  0x40aa29a8  Yes         /usr/lib/libpng12.so.0
0x40abdc00  0x40af7368  Yes         /opt/gnome/lib/libgnomevfs-2.so.0
0x40b266a0  0x40bf9de8  Yes         /usr/lib/libxml2.so.2
0x40c33700  0x40c3f418  Yes         /lib/libz.so.1
0x40c4e420  0x40c6e188  Yes         /usr/lib/libssl.so.0.9.7
0x40ca2bc0  0x40d419a8  Yes         /usr/lib/libcrypto.so.0.9.7
0x40d70e00  0x40d7358e  Yes         /usr/lib/libdns_sd.so
0x40d775e0  0x40d82518  Yes         /lib/libresolv.so.2
0x40d89e30  0x40d8dcf8  Yes         /lib/tls/librt.so.1
0x40daa640  0x40dd97c8  Yes         /opt/gnome/lib/libbonobo-2.so.0
0x40df7850  0x40e14388  Yes         /opt/gnome/lib/libgconf-2.so.4
0x40e25e30  0x40e2e538  Yes         /opt/gnome/lib/libbonobo-activation.so.4
0x40e34c60  0x40e35938  Yes         /opt/gnome/lib/libORBitCosNaming-2.so.0
0x40e4ef50  0x40e75248  Yes         /opt/gnome/lib/libORBit-2.so.0
0x40e91e40  0x40ebd458  Yes         /opt/gnome/lib/libgobject-2.0.so.0
0x40ec7d20  0x40ec8d98  Yes         /opt/gnome/lib/libgmodule-2.0.so.0
0x40ecbc50  0x40ecc968  Yes         /lib/libdl.so.2
0x40ed0190  0x40ed17b8  Yes         /opt/gnome/lib/libgthread-2.0.so.0
0x40ed7310  0x40edf7d8  Yes         /lib/tls/libpthread.so.0
0x40ef3290  0x40f3a3c8  Yes         /opt/gnome/lib/libglib-2.0.so.0
0x40f6f470  0x40f73818  Yes         /usr/lib/libstartup-notification-1.so.0
0x40f77060  0x40f7bb18  Yes         /usr/X11R6/lib/libSM.so.6
0x40f826c0  0x40f92048  Yes         /usr/X11R6/lib/libICE.so.6
0x40fa8550  0x4101bf58  Yes         /usr/X11R6/lib/libX11.so.6
0x410944e0  0x410a55a8  Yes         /usr/lib/libexif.so.12
0x410b8390  0x410d2d78  Yes         /lib/tls/libm.so.6
0x410dc210  0x410e0f08  Yes         /usr/lib/libpopt.so.0
0x410f7c60  0x411dc13c  Yes         /lib/tls/libc.so.6
0x41204be0  0x412060b8  Yes         /usr/X11R6/lib/libXrandr.so.2
0x41209210  0x4120e198  Yes         /usr/X11R6/lib/libXi.so.6
0x412108c0  0x41211368  Yes         /usr/X11R6/lib/libXinerama.so.1
0x41216b00  0x41223f58  Yes         /usr/X11R6/lib/libXft.so.2
0x41226f40  0x41229238  Yes         /usr/X11R6/lib/libXfixes.so.3
0x4122d270  0x41232198  Yes         /usr/X11R6/lib/libXcursor.so.1
0x400007a0  0x40011a6f  Yes         /lib/ld-linux.so.2
0x400275f0  0x400277a8  Yes        
/usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2
0x40029460  0x40029d88  Yes         /usr/lib/gconv/ISO8859-1.so
0x413b8c10  0x413beb48  Yes        
/opt/gnome/lib/gtk-2.0/2.4.0/engines/libindustrial.so
0x413c44e0  0x413c5ed8  Yes        
/opt/gnome/lib/gtk-2.0/2.4.0/loaders/libpixbufloader-png.so
0x413ca280  0x413cdde8  Yes         /opt/gnome/lib/gnome-vfs-2.0/modules/libfile.so
0x413e6f70  0x413eb288  Yes         /usr/lib/libfam.so.0
0x41429450  0x414a35d8  Yes         /usr/lib/libstdc++.so.6
0x414ca6c0  0x414d19f8  Yes         /lib/libgcc_s.so.1
0x414d5b90  0x414dc3f8  Yes         /lib/libnss_files.so.2
0x413d50f0  0x413d5b48  Yes        
/opt/gnome/lib/nautilus/extensions-1.0/libnautilus-fileroller.so
0x413d8370  0x413d9298  Yes        
/opt/gnome/lib/nautilus/extensions-1.0/libnautilus-burn-extension.so
0x413dbbb0  0x413dc0d8  Yes        
/opt/gnome/lib/nautilus/extensions-1.0/libnautilus-fontilus.so
0x413def70  0x413df5d8  Yes        
/opt/gnome/lib/nautilus/extensions-1.0/libnautilus-sendto.so
0x43d865b0  0x43d95298  Yes        
/opt/gnome/lib/nautilus/extensions-1.0/libnautilus-themus.so
0x413e2600  0x413e3418  Yes        
/opt/gnome/lib/libgnome-window-settings.so.10x43db2ea0  0x43dca698  Yes        
/opt/gnome/lib/libmetacity-private.so.0
0x43dd8f30  0x43de57d8  Yes        
/opt/gnome/lib/nautilus/extensions-1.0/libtotem-properties-page.so
0x43df1230  0x43e1fe68  Yes         /usr/lib/libmusicbrainz.so.4
0x43e2cfe0  0x43e2fd28  Yes         /usr/X11R6/lib/libXtst.so.6
0x43e31bd0  0x43e349f8  Yes         /usr/X11R6/lib/libXxf86vm.so.1
0x43e36c10  0x43e374f8  Yes         /opt/gnome/lib/libgstgconf-0.8.so.0
0x43e3b110  0x43e3e638  Yes         /opt/gnome/lib/libgstinterfaces-0.8.so.0
0x43e55280  0x43eadaa8  Yes         /opt/gnome/lib/libgstreamer-0.8.so.1
(gdb)
Comment 11 Michael Meeks 2005-08-19 14:59:42 UTC
info attached
Comment 12 Andreas Schwab 2005-08-19 15:07:47 UTC
NPTL does not use any signals. 
Comment 13 Michael Meeks 2005-08-19 15:36:06 UTC
Let me re-title to make it more clear:

My threaded app deadlocks on the latest kernel when run under gdb - the locked
threads are calling:

      __nptl_setxid from  setegid
and   __lll_mutex_lock_wait from pthread_mutex_destroy

it's just not clear to me how my bug is invalid - can you expand ?
Comment 14 Andreas Schwab 2005-08-19 15:38:50 UTC
Timing is completely different when running under a debugger. 
Comment 15 Michael Meeks 2005-08-19 16:04:29 UTC
Certainly true - I'm not debating that, ignorant as I most certainly am. However
- AFAICS about the worst thing we can have done here is to leave a lock held in
error. It's not clear how not releasing some (presumably unrelated) lock can
stop 'setegid' completing ? - what's the deal there ? any ideas on further
debugging the issue ?
Comment 16 Andreas Schwab 2005-08-19 16:06:44 UTC
This has nothing to do with gdb any more. 
Comment 17 Michael Meeks 2005-08-19 16:10:14 UTC
So - if a bug has nothing to do with gdb anymore - it's invalid ? That's
certainly an innovative approach to reducing bug count ;-)
This is filed in the wrong component ? if so - is it possible you could re-file
it against a more suitable one ? re-opening & passing to the Kernel people ?
Let me do that for you.
Comment 18 Andreas Schwab 2005-08-19 16:12:26 UTC
If you have a new bug open a new bug. 
Comment 19 Andreas Jaeger 2007-05-03 07:13:09 UTC
If this bug is still in openSUSE 10.2, please reopen and add that information.  We're not going to fix this anymore for 10.0.