Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 196031 - sys-devel/gdb unusable with multithreaded apps after upgrade to glibc-2.6.1
Summary: sys-devel/gdb unusable with multithreaded apps after upgrade to glibc-2.6.1
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo Toolchain Maintainers
: 198448 202026 (view as bug list)
Depends on:
Reported: 2007-10-16 11:26 UTC by Axel Mueller
Modified: 2007-12-13 07:24 UTC (History)
4 users (show)

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

glibc-nostrip-libpthread.patch (glibc-nostrip-libpthread.patch,361 bytes, patch)
2007-10-29 23:36 UTC, Nathan Caldwell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Mueller 2007-10-16 11:26:39 UTC
After upgrading to glibc 2.6.1 I cannot debug any program with gdb (6.6-r2) that is multithreaded. If a breakpoint is hit I get:
"ptrace: No such process."
If a try to backtrace then I get the following:
"Couldn't get registers: No such process."

If the application crashes during a gdb session I cannot backtrace, too.

No problem with single threaded applications.

glibc was the only thing I did update. An upgrade to gdb 6.7 did not help. My colleagues have reported the same issue. He did a downgrade of glibc and this solved the problems with gdb.

Reproducible: Always

Portage (default-linux/x86/2007.0, gcc-3.4.6, glibc-2.6.1-r0, 2.6.22-gentoo-r8 i686)
System uname: 2.6.22-gentoo-r8 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Timestamp of tree: Mon, 15 Oct 2007 01:47:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r5
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer -fvisibility-inlines-hidden"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
LINGUAS="en de"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
USE="X acl alsa apache2 bitmap-fonts boundschecking bzip2 cairo cli cracklib crypt cups dbus dri fastcgi gdbm glibc-omitfp gpm gtk2 hal iconv isdnlog jpeg kde midi mmx mudflap ncurses nls nptl nptlonly nsplugin openmp pam pcre pdf perl png pppd python qt readline reflection session spell spl sqlite3 sse sse2 ssl svg tcpd threads tiff truetype-fonts type1-fonts unicode wmf x86 xinerama xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de" USERLAND="GNU" VIDEO_CARDS="i810 vesa mga"
Comment 1 Axel Mueller 2007-10-16 11:30:53 UTC
There is already a bug report filed in at the gdb website.
Bug report 2321.
Comment 2 Nathan Caldwell 2007-10-29 20:42:08 UTC
> I suspect that your or
> is stripped of the symbols GDB needs to debug threads.

So, I tried reemerging glibc with USE="debug" and FEATURES="nostrip".
$ file /lib/ 
/lib/ ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, stripped

$ file /lib/
/lib/ ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, not stripped

And, GDB works now. So it seems that the ebuild is stripping libpthread when it really shouldn't. I tried stripping both and, and the only time GDB gives me the "ptrace: no such process" is when I strip libpthread, stripping doesn't seem to affect GDB at all.

Hopefully one of the glibc maintainers can fix this so we can actually use GDB again without having to install a fully non stripped copy of glibc.
Comment 3 Nathan Caldwell 2007-10-29 23:36:51 UTC
Created attachment 134666 [details, diff]

Here's a patch to fix stripping of libpthread. Hopefully this will speed the integration into the ebuild (well technically the eblit file) itself a little bit.

It also looks like this isn't the first time this has happened see Bug 46186. Also notice the last comment, it looks like someone noticed earlier as well.
Comment 4 SpanKY gentoo-dev 2007-12-09 09:11:19 UTC
*** Bug 198448 has been marked as a duplicate of this bug. ***
Comment 5 SpanKY gentoo-dev 2007-12-10 01:22:38 UTC
fixed in cvs and released with glibc-2.7-r1
Comment 6 SpanKY gentoo-dev 2007-12-13 07:24:06 UTC
*** Bug 202026 has been marked as a duplicate of this bug. ***