Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92794 - glibc 2.3.5 with nptl and linuxthread generates a none working nptl version.
Summary: glibc 2.3.5 with nptl and linuxthread generates a none working nptl version.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: PPC Linux
: Highest critical (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-16 07:49 UTC by J.O. Aho
Modified: 2006-01-15 15:37 UTC (History)
3 users (show)

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


Attachments
ld.so fix (ppc-nptl.patch,1002 bytes, patch)
2006-01-10 17:17 UTC, Joe Jezak (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description J.O. Aho 2005-05-16 07:49:12 UTC
When building glibc 2.3.5 with nptl support (USE=nptl), both the linuxthread and nptl compiles without any errors, but everything run after that will cause a segfault if you don't use the LD_ASSUME_KERNEL=2.4.1 infront of your commands.

Reproducible: Always
Steps to Reproduce:
1. set ACCEPT_KEYWORDS="~ppc"
2. set USE="nptl"
3. emerge glibc

Actual Results:  
The nptl version of glibc causes segfaults for all commands.

Expected Results:  
The commands should be executed like they are done with glibc 2.3.4.

Portage 2.0.51.21-r1 (default-linux/ppc/2005.0, gcc-3.4.3-20050110,
glibc-2.3.4.20041102-r1, 2.6.10-pegasos-r3 ppc)
=================================================================
System uname: 2.6.10-pegasos-r3 ppc 7447/7457, altivec supported
Gentoo Base System version 1.4.16
dev-lang/python:     2.3.4-r1
sys-apps/sandbox:    1.2.7
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.4
sys-devel/binutils:  2.15.90.0.3-r4
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r4
ACCEPT_KEYWORDS="ppc ~ppc"
AUTOCLEAN="yes"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -mcpu=7400 -mtune=7400  -maltivec -mabi=altivec -pipe
-fno-strict-aliasing"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=7400 -mtune=7400  -maltivec -mabi=altivec -pipe
-fno-strict-aliasing"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/
ftp://trumpetti.atm.tut.fi/gentoo/ ftp://ftp.du.se/pub/os/gentoo
ftp://mirror.pudas.net/gentoo http://ftp.linux.ee/pub/gentoo/distfiles/
ftp://ftp.linux.ee/pub/gentoo/distfiles/
ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp.du.se/pub/os/gentoo"
LANG="en_US"
LC_ALL="en_US"
LINGUAS="en_GB"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/servers/portage"
SYNC="rsync://kotiaho.net/gentoo-portage"
USE="ppc X alsa altivec berkdb bitmap-fonts cdr crypt cups dvd dvdr emacs emboss
ffmpeg fortran gif gnome gphoto2 gpm gtk gtk2 ipv6 jpeg kde lame libwww mbox
motif mp3 mpeg mysql ncurses nls nocd nptl oggvorbis opengl pam pdflib perl png
python qt readline sdl spell ssl tcpd transcode truetype truetype-fonts
type1-fonts udev unicode usb xft xml2 xprint xv xvid zlib linguas_en_GB
userland_GNU kernel_linux elibc_glibc"
Comment 1 J.O. Aho 2005-05-17 11:29:57 UTC
Forgot to mention that this is a quite fresh Gentoo 2005.0 install, but had this
problem on my previous Gentoo LinuxPPC install which I did wipe out due glibc
didn't work.
Comment 2 Luca Barbato gentoo-dev 2005-06-02 08:19:26 UTC
looks like the problem is in ldconfig and the ld.so.cache generated.
Removing it seems to fix the problem, regenerating it make it appear again.
Comment 3 Joe Jezak (RETIRED) gentoo-dev 2005-06-02 09:52:37 UTC
As a workaround, compile glibc with nptl nptlonly or -ntpl -nptlonly until this
problem is resolved.
Comment 4 Joe Jezak (RETIRED) gentoo-dev 2005-06-17 10:23:45 UTC
Here's an update:

It turns out that we get segfaults when the following conditions are met:
1. ld.so.cache is present
2. the binary we are attempting to run is linked against *only*
/lib/tls/libc.so.6  and nothing else in /lib/tls

Removing /etc/ld.so.cache will prevent segfaults.

If a binary is linked against libc.so.6 *and* something else from /lib/tls (such
as libm or libpthreads) it will still work with /etc/ld.so.cache present.

Replacing ld.so.1 with a copy from a good compile of glibc-2.3.4.20041102 fixes
the problem.

I'm currently trying to figure out what changed between the two versions and
will provide a follow up if I figure anything out.
Comment 5 J.O. Aho 2005-06-19 13:34:26 UTC
Okey, it's good to see that there is a bit progress here, I don't have the
option to make only nptl or linuxthreads and would like to install gcc 4.0.1 to
get the build in altivec optimization to see if boinc will increase in
preformance or not.
Comment 6 J.O. Aho 2005-07-16 02:06:24 UTC
Heared that you guys are discussing this matter without any results on solving
this problem. Noticed that glibc 2.3.5 has ben made stable on x86, you guys know
if this problem is there too or if it's only PPC?

And no, I can't point out a program that don't work with nptl, but do have
netscape 4 (PLD version) installed, which could be one that needs linuxthreads.
Comment 7 Joe Jezak (RETIRED) gentoo-dev 2005-10-16 20:53:54 UTC
We've decided to force either nptl or linuxthreads, there's not much else we can
do since nobody has come up with a solution and it seems gentoo specific. 
glibc-2.3.5-r2 is now stable.
Comment 8 Tom Lloyd 2005-11-13 15:20:12 UTC
Well this looks like the place to put this.

I recently upgraded to glibc-2.3.5 (I reckon that's probably the cause).
Since then, whenever I have both tvtime and boinc/setiathome running, as soon as
*anything* else taxes the CPU, my entire system goes down.  This can be
something as small as copying a big file or loading a complex website in Firefox
- compiling anything doesn't stand a chance.

It's OK to do these things if I don't have tvtime running, or if I shutdown
boinc.  In the interests of investigation I upgraded to a newer version of
tvtime, so I don't reckon it's that.  I think it's the combination of
glibc-2.3.5, TV watching and boinc's feature to step out of the way whenever
anything else wants the CPU that's combining to cause this system crash.

I'm currently using:
glibc-2.3.5-r2 with NPTL
tvtime-1.0.1 (was 0.9.15)
gentoo-sources-2.6.14
Comment 9 Joe Jezak (RETIRED) gentoo-dev 2005-11-21 20:01:46 UTC
Just to note, the problem persists in glibc-2.3.6.
Comment 10 Arthur Corliss 2005-11-29 01:15:20 UTC
I discovered you're having the same problems I am with my distribution.  The
good news is that there is a very simple solution:  since you're building glibc
twice (first with linuxthreads, second with nptl) just overwrite the
linuxthreads /lib/ld-2.3.5.so with /lib/tls/ld-2.3.5.so and it works fine in
both instances.

I've tested this w/Nevaeh Linux running glibc-2.3.5 compiled with gcc-3.4.4 and
binutils-2.16.1 on an IBM p5-570 (POWER5 processor).  Before overwriting
/lib/ld-2.3.5.so the following test failed:

echo 'int main() { return 0; }' > test.c
gcc test.c
./a.out 
(segmentation fault)
LD_ASSUME_KERNEL=2.4.1 ./a.out
(success)

After overwriting /lib/ld-2.3.5.so the above test succeeds, and ldd shows the
proper library selected depending on the value LD_ASSUME_KERNEL.

  --Arthur Corliss
    acorliss@nevaeh-linux.org
Comment 11 Joe Jezak (RETIRED) gentoo-dev 2006-01-10 17:17:13 UTC
Created attachment 76792 [details, diff]
ld.so fix

You're absolutely right! :)  Thanks for the info.

Here's a patch that does exactly that.  If we could have a few testers, that would be great.
Comment 12 Lars Weiler (RETIRED) gentoo-dev 2006-01-11 02:27:43 UTC
I'll build some G4 testing stages with the patch applied.
Comment 13 Lars Weiler (RETIRED) gentoo-dev 2006-01-11 13:29:32 UTC
G4-stages built.  A test given by JoseJX in a chroot was good:

elrohir / # LD_ASSUME_KERNEL=2.4.1 ldd /bin/grep
        libc.so.6 => /lib/libc.so.6 (0x0feb2000)
        /lib/ld.so.1 (0x30000000)
elrohir / # ldd /bin/grep
        libc.so.6 => /lib/tls/libc.so.6 (0x0feb1000)
        /lib/ld.so.1 (0x30000000)
elrohir / # 
Comment 14 Joe Jezak (RETIRED) gentoo-dev 2006-01-15 15:37:43 UTC
This workaround has been added to the glibc-2.3.5-r3 and glibc-2.3.6-r2 ebuilds.  Please reopen if you have a problem.