Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 269307 - [PATCH] sys-devel/gdb doesn't work with sys-libs/glibc-2.9 and sys-devel/gcc-4.4 (optimizes away glibc function)
Summary: [PATCH] sys-devel/gdb doesn't work with sys-libs/glibc-2.9 and sys-devel/gcc-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-4.4
  Show dependency tree
 
Reported: 2009-05-10 20:51 UTC by Mikel Olasagasti
Modified: 2009-07-05 19:42 UTC (History)
5 users (show)

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


Attachments
Ebuild to apply Red Hat patch (glibc-2.9_p20081201-r2.ebuild,7.59 KB, text/plain)
2009-06-29 10:17 UTC, MageSlayer
Details
Red Hat patch adapted to Gentoo (gcc4-fix.patch,1.16 KB, patch)
2009-06-29 10:18 UTC, MageSlayer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikel Olasagasti 2009-05-10 20:51:32 UTC
I can't use gdb as I get following error:

[Thread debugging using libthread_db enabled]
Error while reading shared library symbols:
find_new_threads_callback: cannot get thread info: generic error

More info at https://bugzilla.redhat.com/show_bug.cgi?id=487212

Reproducible: Always

Steps to Reproduce:




Portage 2.1.6.13 (default/linux/amd64/2008.0/no-multilib, gcc-4.4.0, glibc-2.9_p20081201-r2, 2.6.29-gentoo-r2 x86_64)
=================================================================
System uname: Linux-2.6.29-gentoo-r2-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.0.0
Timestamp of tree: Sun, 10 May 2009 15:15:02 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p17-r1
dev-lang/python:     2.5.4-r2, 2.6.2
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.3-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r2
sys-apps/sandbox:    1.9
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.29
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -msse4 -msse4.1 -msse4.2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=core2 -msse4 -msse4.1 -msse4.2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo "
LDFLAGS="-Wl,-O1"
LINGUAS="eu"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/mozilla /usr/local/portage/layman/gnome"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acl acpi alsa amd64 autoipd avahi berkdb bzip2 cairo cdr cli consolekit cracklib crypt cups daap dbus dirac dri eds exif faac fortran fuse gdbm gnome gnome-keyring gnutls gpm graphite gstreamer gtk hal iconv ipod ipv6 isdnlog jingle jpeg jpeg2k kpathsea libaa libcaca libnotify midi mmx mp3 msn mudflap musicbrainz nautilus ncurses networkmanager nls nptl nptlonly ogg openal opengl openmp pam pcre pdf perl png pppd pulseaudio python readline reflection samba session smp soup spl sqlite sse sse2 sse3 ssl ssse3 svg sysfs tcpd theora tiff tracker truetype unicode vorbis webkit xcb xmp xorg xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="eu" USERLAND="GNU" VIDEO_CARDS="nvidia nv nouveau"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Peter Alfredsen (RETIRED) gentoo-dev 2009-05-10 20:59:32 UTC
I can reproduce with gcc-4.4 and glibc-2.8 using the test case from the redhat bug:
echo 'int main (void) { return 0; }' >threadmain.c
gcc -o threadmain threadmain.c -Wall -g -pthread
gdb -nx -ex r ./threadmain

From the info provided in the redhat bug (namely that an earlier version of glibc-2.9 -- probably compiled with gcc-4.3 -- fixed it), I'm guessing that it is an optimization new to gcc-4.4 that causes this.

Portage 2.2_rc28 (default/linux/amd64/2008.0, gcc-4.4.0, glibc-2.8_p20080602-r1, 2.6.28.10 x86_64)
=================================================================
System uname: Linux-2.6.28.10-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9550_@_2.83GHz-with-gentoo-2.0.0
[...]
Comment 2 Peter Alfredsen (RETIRED) gentoo-dev 2009-05-10 21:01:54 UTC
http://cvs.fedora.redhat.com/viewvc/devel/glibc/thread_db.patch?view=co
This looks like the fix.
Comment 3 Evan Teran 2009-05-29 05:00:46 UTC
how soon till we can get this patch commited? gdb is entirely unusable without it :(
Comment 4 MageSlayer 2009-06-29 10:17:08 UTC
Created attachment 196051 [details]
Ebuild to apply Red Hat patch
Comment 5 MageSlayer 2009-06-29 10:18:13 UTC
Created attachment 196052 [details, diff]
Red Hat patch adapted to Gentoo
Comment 6 MageSlayer 2009-06-29 10:19:19 UTC
Tested with Lazarus IDE 0.9.27 svn
Comment 7 SpanKY gentoo-dev 2009-07-05 19:39:58 UTC
this is already fixed in glibc-2.10.1 and gcc-4.4 is pmasked.  so from what i can see, the current stable and unstable tree are working fine.  this is only an issue when you attempt to install an unstable package masked gcc into an otherwise stable system.

if i do another glibc-2.9 rev, i'll include this fix, but otherwise there is nothing to be done here.