Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41435 - gdb 6.0 gives incoherent backtraces in multithreaded programs
Summary: gdb 6.0 gives incoherent backtraces in multithreaded programs
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on: 40464
Blocks:
  Show dependency tree
 
Reported: 2004-02-12 17:57 UTC by Michael C. Martin
Modified: 2004-10-03 01:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
sample backtraces from gdb 6.0 and 5.3 (backtraces.txt,10.96 KB, text/plain)
2004-02-12 18:00 UTC, Michael C. Martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael C. Martin 2004-02-12 17:57:50 UTC
When debugging a multithreaded program, gdb 6.0 does not give backtraces beyond the first pthread call, making it effectively impossible to track down where in the application program calls are being made.  gdb 5.3 provides complete backtraces.  Recompilation of applications does not affect results.

Reproducible: Always
Steps to Reproduce:
1. emerge gdb-6.0.
2. Compile an application that needs pthreads.
3. Run it under gdb, interrupt it, and enter the "thread apply all backtrace" command.

Actual Results:  
Very brief backtraces were given for all threads, none of which managed to reach
above the level of the SDL libraries (which made the pthreads calls directly).

Expected Results:  
The backtraces should have gone all the way back through into the top level
application.

For comparison, an attachment includes two backtraces from the same point in the
cvs version of games-strategy/uqm -- one from gdb 5.3, and one from gdb 6.0. 
Relevant other notes:
On startup, gdb 6.0 gives the line

Using host libthread_db library "/lib/libthread_db.so.1".

while 5.3 does not.  Bug #30841 also implies that gdb 6.0 is required for NPTL
support; this system does not use NPTL.  (First line of emerge info says Portage
2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.22-gentoo-r3).)

Workaround is to downgrade gdb, keeping it at 5.3.
Comment 1 Michael C. Martin 2004-02-12 17:59:07 UTC
The referenced bug should be Bug #40464, not 30841.
Comment 2 Michael C. Martin 2004-02-12 18:00:50 UTC
Created attachment 25510 [details]
sample backtraces from gdb 6.0 and 5.3

These are the sample backtraces from UQM under gdb 6.0 (first) and 5.3
(second).
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-19 11:26:56 UTC
libsdl among others is not compiled with -ggdb, and also stripped.  Rectify
this for all libs used, as well as app, and reopen if still an issue.
Comment 4 Michael C. Martin 2004-02-19 13:43:26 UTC
re-emerging SDL and recompiling app with -ggdb has no effect on backtrace.  The app has always been compiled with -g alone, nor was the app ever stripped.  Even when SDL *was* stripped, 5.3 could (and can) still produce backtraces inside the app.
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-19 15:05:50 UTC
Its automatically stripped by portage ...
Comment 6 Michael C. Martin 2004-02-19 17:13:23 UTC
The sample backtrace is given is with the default libSDL emerge - does gdb 6.0 add the requirement that nothing may be stripped?  5.3 goes through it with no difficulty.
Comment 7 Michael C. Martin 2004-04-16 19:23:19 UTC
This problem does not occur with breakpoints; a thread with a breakpoint in it will give a proper backtrace (though all the others will still give "??" for almost every frame, unlike gdb 5.3).

This may just be a change in functionality between 6.0 and 5.3.
Comment 8 SpanKY gentoo-dev 2004-10-03 01:32:45 UTC
please try with latest gdb and glibc