Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 105535 - glibc-2.3.5-r1 breaks 32bit compatibility
Summary: glibc-2.3.5-r1 breaks 32bit compatibility
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High critical (vote)
Assignee: AMD64 Project
URL:
Whiteboard:
Keywords:
: 108248 110773 112558 115549 118135 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-10 14:00 UTC by Róbert Čerňanský
Modified: 2006-01-24 11:09 UTC (History)
5 users (show)

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


Attachments
emerge glibc (glib.log,18.40 KB, text/plain)
2005-10-06 08:25 UTC, petr bravenec
Details
3086-glibc-2.3.5-r2.log (x,9.99 KB, text/plain)
2005-10-06 10:11 UTC, petr bravenec
Details
emerge glibc-2.3.5-r1 (emerge-glibc.log.bz2,327.23 KB, application/octet-stream)
2005-10-06 10:17 UTC, Róbert Čerňanský
Details
emerge glibc >& emerge-glibc.log (emerge-glibc.log.bz2,171.00 KB, application/bzip2)
2005-10-16 21:16 UTC, Olivier Bilodeau
Details
log of the configure script (glibc_config.log,41.16 KB, text/plain)
2005-10-30 02:07 UTC, Ruslan U. Zakirov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Róbert Čerňanský 2005-09-10 14:00:03 UTC
After 'update world', the 32bit applications stops working:

$ quake3
/usr/games/bin/quake3: line 4: /opt/quake3/quake3.x86: Accessing a corrupted
shared library
/usr/games/bin/quake3: line 4: /opt/quake3/quake3.x86: Success

Packages gcc and glibc was upgraded in this update:

[...]
[ebuild     U ] sys-devel/gcc-3.4.4-r1 [3.4.3-r1] (-altivec) -bootstrap
-boundschecking -build +fortran -gcj +gtk -hardened -ip28 (-multilib) -multislot
(-n32) (-n64) +nls -nocxx -nopie -nossp -objc -static -vanilla 27,036 kB 
[ebuild     U ] sys-libs/glibc-2.3.5-r1 [2.3.5] -build -erandom -glibc-compat20
-glibc-omitfp -hardened -linuxthreads-tls (-multilib) +nls -nptl -nptlonly -pic
-profile (-selinux) +userlocales 1,267 kB 
[...]

Before update I've made "backup" package of glibc (2.3.5) with quickpkg command.
When I emerged it, everything is working fine. I'm using 2005.0 profile from the
begining. I've never used 2004.x.

# emerge --info
Portage 2.0.51.22-r2 (default-linux/amd64/2005.0, gcc-3.4.4, glibc-2.3.5-r0,
2.6.12-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.12-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.10
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.6
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64 -fomit-frame-pointer -fweb -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /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 -march=athlon64 -fomit-frame-pointer -fweb -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo
http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/opt/reserve/install/portage/hs
/opt/reserve/install/portage/mplayer32"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 3dnowex X Xaw3d a52 aac aalib aim alsa avi bash-completion berkdb
bitmap-fonts bluetooth bonobo bzlib cdparanoia cdr crypt cups curl dga dts dv
dvd dvdr edl emacs emboss encode ethereal exif fbcon ffmpeg flac flash
font-server foomaticdb fortran ftp gdbm gif gimpprint gphoto2 gpm gtk gtk2
gtkhtml guile iconv icq imagemagic imagemagick imap imlib ipv6 jabber jack jbig
jpeg junit ladcca lcms leim libcaca libwww live lm_sensors lzw lzw-tiff mad
maildir matroska mikmod mime mng motif mozsvg mp3 mpeg msn mule ncurses network
new-login nls nowin nvidia ofx ogg oggvorbis opengl oscar oss pam pda pdflib
perl png pnp portaudio ppds python qt quicktime readline real recode rtc samba
sdl slang snmp sockets sox speex spell ssl svg tcltk tcpd theora tiff truetype
truetype-fonts type1-fonts unicode usb userlocales vcd vorbis wmf wxwindows
xface xml xml2 xmms xosd xpm xscreensaver xv xvmc yahoo zlib userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Róbert Čerňanský 2005-09-11 09:27:36 UTC
I found another workaround in gentoo-amd64 mailing list archive
(http://marc.theaimsgroup.com/?l=gentoo-amd64&m=112329353322198&w=2). It can be
more helpful. It is about that symlink /lib/ld-linux.so.2 points to wrong
destination.

Situation in glibc-2.3.5:

lrwxrwxrwx  1 root root 22 Sep 11 18:02 /lib/ld-linux.so.2 -> ../lib32/ld-linux.so.2

Situation in glibc-2.3.5-r1:

lrwxrwxrwx  1 root root 11 Sep 11 18:21 /lib/ld-linux.so.2 -> ld-2.3.5.so
Comment 2 SpanKY gentoo-dev 2005-10-06 08:16:56 UTC
*** Bug 108248 has been marked as a duplicate of this bug. ***
Comment 3 SpanKY gentoo-dev 2005-10-06 08:20:26 UTC
can someone run this:
emerge glibc >& log

and then post the log file as an attachment
Comment 4 petr bravenec 2005-10-06 08:25:37 UTC
Created attachment 69993 [details]
emerge glibc
Comment 5 SpanKY gentoo-dev 2005-10-06 09:05:55 UTC
Comment on attachment 69993 [details]
emerge glibc

sorry, lemme be more specific ... can someone post a log of glibc emerging
which results in the system breaking ... it has to show the
compile/install/merge stages in other words

if anyone has portage logging enabled, you could find probably find one in
/var/log/portage/ ...
Comment 6 petr bravenec 2005-10-06 10:11:26 UTC
Created attachment 70005 [details]
3086-glibc-2.3.5-r2.log

I hope this is what you needed. It's made with PORT_LOGDIR set in make.conf.
Comment 7 Róbert Čerňanský 2005-10-06 10:17:55 UTC
Created attachment 70006 [details]
emerge glibc-2.3.5-r1

This is full log of emerge glibc-2.3.5-r1 which produces wrong symlink and
breaks 32bit compatibility.

# ll /lib/ld-linux.so.2 
lrwxrwxrwx  1 root root 11 Oct	6 18:44 /lib/ld-linux.so.2 -> ld-2.3.5.so

While installing it seems that symlink is created correctly but then
overwritten with wrong symlink:

# grep "ld-linux.so.2 ->" emerge-glibc.log 
>>> /lib/ld-linux.so.2 -> ../lib32/ld-linux.so.2
>>> /lib32/ld-linux.so.2 -> ld-2.3.5.so
>>> /lib64/ld-linux.so.2 -> ld-2.3.5.so
Comment 8 SpanKY gentoo-dev 2005-10-06 21:49:13 UTC
err, what does this show on your machine ?
ls -ld /lib*
Comment 9 SpanKY gentoo-dev 2005-10-06 21:59:45 UTC
yeah, that last bit shouldnt exist ...

correct (i.e. what i have):
/lib/ld-linux.so.2 -> ../lib32/ld-linux.so.2
/lib32/ld-2.3.5.so
/lib32/ld-linux.so.2 -> ld-2.3.5.so
/lib64/ld-2.3.5.so
/lib64/ld-linux-x86-64.so.2 -> ld-2.3.5.so

wrong (i.e. what you guys are being screwed with):
/lib/ld-linux.so.2 -> ../lib32/ld-linux.so.2
/lib32/ld-2.3.5.so
/lib32/ld-linux.so.2 -> ld-2.3.5.so
/lib64/ld-2.3.5.so
/lib64/ld-linux-x86-64.so.2 -> ld-2.3.5.so
/lib64/ld-linux.so.2 -> ld-2.3.5.so
Comment 10 Róbert Čerňanský 2005-10-06 23:20:08 UTC
$ ls -ld /lib*
lrwxrwxrwx  1 root root    5 Aug 13 13:18 /lib -> lib64
drwxr-xr-x  2 root root 4096 Oct  6 19:58 /lib32
drwxr-xr-x  9 root root 4096 Oct  6 19:58 /lib64
Comment 11 kavol 2005-10-08 14:37:42 UTC
Robert, thanks for the link-repair workaround 
 
the bug was reported a month ago ... how is it possible that my system still 
suffered from it after a fresh (today) update, especially when the workaround 
is so easy? :-( 
 
well, I do not want to say that the Gentoo developers are doing bad job, no, I 
would like to thank them a lot, but sometimes, a bit more testing and repairing 
would be appreticiated more ... even if we do not want to end like stable 
Debian ;-) 
Comment 12 SpanKY gentoo-dev 2005-10-08 20:47:12 UTC
if you dont have anything helpful to add, dont bother commenting
Comment 13 Olivier Bilodeau 2005-10-16 21:16:07 UTC
Created attachment 70824 [details]
emerge glibc >& emerge-glibc.log
Comment 14 Olivier Bilodeau 2005-10-16 21:18:55 UTC
Experiencing same problem here, except that I don't have either of these files:
/lib32/ld-2.3.5.so
/lib32/ld-linux.so.2 -> ld-2.3.5.so

glibc-2.3.5-r2
/lib64 symlinked to /lib

#ls -l /lib/ld-*
-rwxr-xr-x  1 root root 113669 Oct 16 22:59 /lib/ld-2.3.5.so
lrwxrwxrwx  1 root root     11 Oct 16 22:59 /lib/ld-linux-x86-64.so.2 -> ld-2.3.
5.so

#ls -l /lib32/*
-rwxr-xr-x  1 root root 28724 Apr 19 18:24 /lib32/libsandbox.so

obviously a lot of stuff is missing..
I emerged most of the emul- stuff just in case even though I think it's not 
relevant since 2005.0..

I just attached: emerge glibc >& emerge-glibc.log
Sorry if it's before comment, it's my first attach. in bugzilla.. hmm..

#emerge info
Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.
12-gentoo-r9becks x86_64)
=================================================================
System uname: 2.6.12-gentoo-r9becks x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.11
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.6-r1
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64 x86"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/
share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /
usr/lib64/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://mirrors.tds.net/gentoo 
ftp://mirrors.tds.net/gentoo"
LANG="en_CA.UTF-8"
LC_ALL="en_CA.UTF-8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X aac aalib acpi alsa apm arts avi berkdb bitmap-fonts 
bonobo cdr crypt cups curl divx4linux doc dvd dvdread eds emboss encode esd fam 
fame ffmpeg flac foomaticdb fortran gd gdbm gif gimpprint gnome gnutls gphoto2 
gpm gstreamer gtk gtk2 gtkhtml imagemagick imlib inkjar ipv6 java joystick jpeg 
junit kde ldap libg++ libwww mad matroska mikmod mng motif mozilla mp3 mpeg 
musicbrainz mysql ncurses nls offensive ogg oggvorbis opengl oss pam pdflib perl 
plugin png ppds python qt quicktime readline real ruby samba sdl slang spell ssl 
svg tcltk tcpd theora tiff truetype truetype-fonts type1-fonts unicode 
userlocales utf8 v4l v4l2 visualization vorbis win32codecs xine xinerama xml 
xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

Comment 15 Olivier Bilodeau 2005-10-25 09:45:35 UTC
Ignore my report (Olivier Bilodeau).

I made a silly mistake when I switched to profile 2005.1.  I pointed to [...]/
x86/2005.1 instead of [...]/amd64/2005.1 as you can see in my emerge info.

Sorry for the bad report.
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2005-10-29 03:11:18 UTC
*** Bug 110773 has been marked as a duplicate of this bug. ***
Comment 17 Ruslan U. Zakirov 2005-10-30 02:07:40 UTC
Created attachment 71714 [details]
log of the configure script

Here is config.log, size of long double test fails with seg fault.
If you need additional info let me know.
Comment 18 Ruslan U. Zakirov 2005-10-30 02:27:04 UTC
Checked symlinks(https://bugs.gentoo.org/show_bug.cgi?id=105535#c9).
1) /lib in my system is symlink for /lib64
2) /lib64/ld-linux.so.2 is symlink to ../lib32/ld-linux.so.2
I tried to change this symlink to
cubic-pc lib64 # ls -ld ld*
-rwxr-xr-x  1 root root 107498 Окт 14 20:11 ld-2.3.5.so
lrwxrwxrwx  1 root root     11 Окт 30 13:21 ld-linux.so.2 -> ld-2.3.5.so
lrwxrwxrwx  1 root root     11 Окт 14 20:12 ld-linux-x86-64.so.2 -> ld-2.3.5.so

This didn't help, I still couldn't emerge glibc.


Also want to note that I don't see problems with 32bit applications, at least
openoffice-bin and acroread work as expected with no problems.

Comment 19 Jakub Moc (RETIRED) gentoo-dev 2005-11-14 14:58:09 UTC
*** Bug 112558 has been marked as a duplicate of this bug. ***
Comment 20 Nicholas Doyle 2005-11-14 15:45:41 UTC
Having the exact same problem as Ruslan U. Zakirov. No 32bit troubles, glibc is
actually failing to build, not producing bad symlinks.
Comment 21 Róbert Čerňanský 2005-12-05 08:29:15 UTC
Just for the information: problem (as described in original post) remains also
in glibc-2.3.5-r2.
Comment 22 SpanKY gentoo-dev 2005-12-14 10:33:55 UTC
*** Bug 115549 has been marked as a duplicate of this bug. ***
Comment 23 Ruslan U. Zakirov 2005-12-27 06:31:37 UTC
I've fixed my issue with help from SpanKY. Big thanks.
Issue on my system was that I had /usr/lib64 as relative symlink to other place, as I've changed symlink to 'mount --bind' solution and it all works.

Also I've found thread http://forums.gentoo.org/viewtopic-t-293507.html that could be very helpful.
Comment 24 Jakub Moc (RETIRED) gentoo-dev 2006-01-07 02:33:23 UTC
*** Bug 118135 has been marked as a duplicate of this bug. ***
Comment 25 Róbert Čerňanský 2006-01-23 12:41:29 UTC
I've debugged it and found the reason of this bug.

The ground of the problem is different sorting behavior in sk_SK (and probably also cs_CZ) locale. I do not know if it is a bug but in sk_SK locale the letters have precedence before digits, and "." have precedence before "-":

$ LC_COLLATE=C ls
ld-2.3.5.so
ld-linux.so.2
libthread_db-1.0.so
libthread_db.so.1

$ LC_COLLATE=sk_SK ls
ld-linux.so.2
ld-2.3.5.so
libthread_db.so.1
libthread_db-1.0.so

Unfortunately glibc ebuild relies on this.

In function toolchain-glibc_src_install(), just before 'prepallstrip', are loops where some libs are temporarily moved to thread-backup dir

	for x in ${D}$(alt_libdir)/lib{pthread,thread_db}* \
	         ${D}$(alt_libdir)/ld-* ; do
		[[ -f ${x} ]] && mv -f ${x} ${T}/thread-backup/
	done
	if want_linuxthreads && want_nptl ; then
		mkdir -p ${T}/thread-backup/tls
		for x in ${D}$(alt_libdir)/tls/lib{pthread,thread_db}* ; do
			[[ -f ${x} ]] && mv -f ${x} ${T}/thread-backup/tls
		done
	fi
	env -uRESTRICT CHOST=${CTARGET} prepallstrip
	cp -a -- ${T}/thread-backup/* ${D}$(alt_libdir)/ || die

In the "correct" environment (C, POSIX locale) the order in which files are moved is:

libpthread-0.10.so
libpthread.so.0 (symlink to libpthread-0.10.so)
libthread_db-1.0.so
libthread_db.so.1 (symlink to libthread_db-1.0.so)
ld-2.3.5.so
ld-linux-x86-64.so.2 (symlink to ld-2.3.5.so)

So, the libpthread-0.10.so file is moved first, then the symlink libpthread.so.0 is about to be moved but is not, because is not valid anymore, and so on. In the end, regular files are moved but symlinks not.

In the "incorrect" environment (LC_COLLATE=sk_SK) the order is that symlinks are moved _before_ regular files (because of "wrong" sorting), thus in the end, regular files _and_ symlinks are moved. That's it. This causes that symlink ld-linux.so.2 appears in image/lib64 directory and later in qmerge phase replaces the correct one.

Strange is, that 'unset LC_COLLATE' in the ebuild does not help. I've tried it - the variable is unset (I've chcecked it by printing its value) but sorting have still sk_SK behavior (bash magic?!?). But 'LC_COLLATE=C' _works_ (see diff below). Unset this variable in the command line (before running emerge command), works also.

This is diff -p glibc-2.3.5-r2.ebuild glibc-2.3.5-r2.ebuild.new

*************** toolchain-glibc_src_install() {
*** 284,289 ****
--- 284,290 ----
  	# These should not be set, else the
  	# zoneinfo do not always get installed ...
  	unset LANGUAGE LANG LC_ALL
+ 	LC_COLLATE=C
  
  	if want_linuxthreads ; then
  		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads


Hope this helps. ;-)
Comment 26 SpanKY gentoo-dev 2006-01-23 12:51:52 UTC
that code no longer exists in newer glibc as i rewrote it for other things

try one of the ebuilds which has a 'src_strip' func in it

also, rather than set specific variables, might as well just export LC_ALL=C
Comment 27 Róbert Čerňanský 2006-01-24 10:43:31 UTC
Great! Bug is not present in recent ebuilds. After sync and re-emerging glibc-2.3.5-r2, 32-bit apps works fine.
Comment 28 SpanKY gentoo-dev 2006-01-24 11:09:37 UTC
thanks for testing