Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 63955 - Stripping of glibc ld-linux.so causes GDB to be unable to debug explicitly loaded dynamic code
Summary: Stripping of glibc ld-linux.so causes GDB to be unable to debug explicitly lo...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-13 18:46 UTC by Josh Green
Modified: 2005-03-08 07:39 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Green 2004-09-13 18:46:11 UTC
When /lib/ld-linux.so.2 gets stripped it loses a symbol called '_dl_debug_state" which GDB uses to set break points in dlopen'd libraries. Thus making debugging of run time loaded code rather impossible.
Here is the warning output by GDB during a debug session:

warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.

I was able to resolve this issue with:
FEATURES="nostrip" emerge glibc

I saw some patches to debian builds that will strip the ld-linux.so but exclude the _dl_debug_state with the -K switch to strip.


Reproducible: Always
Steps to Reproduce:
1. Emerge a stripped version of glibc
2. Run GDB on a program that loads shared objects at run time
3. Note the inability to set breakpoints in shared object code
Comment 1 solar (RETIRED) gentoo-dev 2004-09-13 19:36:07 UTC
You failed to provide enough info or do your homework...
Please read http://www.catb.org/~esr/faqs/smart-questions.html

1) what version of glibc are you talking about.
2) this bug has been resolved already.
3) you failed to search bugzilla for dups.
Comment 2 solar (RETIRED) gentoo-dev 2004-09-13 19:36:44 UTC
Sorry if the above seems harsh at all. We just see alot of dups.
Comment 3 Josh Green 2004-09-13 20:23:46 UTC
I apologize for not providing the version of glibc. But as to searching for dups, I did, quite thoroughly. Sometimes its hard to find things in the bug database, especially since its not segragated by package. Just wanted to make sure it was something that had been reported, next time I'll try and do better.

glibc 2.3.3.20040420-r1
Comment 4 Ernst Herzberg 2004-09-27 10:56:20 UTC
Look like that this BUG is _not_ fixed, at least not in the stable tree;-)

Take a look at BUG #46186:

------- Additional Comment #10 From SpanKY 2004-08-02 17:01 PST ------- 
fixed in glibc-2.2.5-r9, glibc-2.3.2-r10, and glibc-2.3.4.20040619
 
I missing sys-libs/glibc-2.3.3.20040420-r1

This version is the current stable version, and in this ebuild the fix is missing.
Comment 5 Marcel Wiesweg 2005-03-08 07:39:29 UTC
Please note that the bug is not fixed. Tested with glibc-2.3.4.20040808-r1, the current stable version. The fix for #46186 only keeps the thread libs from being stripped, the linker is still stripped.

As a workaround I added the lines

+ # Also, don't strip the dynamic linker:
+ mv ${D}/$(get_libdir)/ld-* ${T}/thread-backup

as suggested in http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&threadm=3wDpJ-16j-21%40gated-at.bofh.it&rnum=1&prev=/groups%3Fhl%3Dde%26lr%3D%26ie%3DUTF-8%26selm%3D3wDpJ-16j-21%2540gated-at.bofh.it