Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 434856 - sys-libs/glibc: hardfp ldso rename sometimes causes binaries to segfault when mixing old/new ldso names
Summary: sys-libs/glibc: hardfp ldso rename sometimes causes binaries to segfault when...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
Depends on:
Reported: 2012-09-13 03:23 UTC by William Throwe
Modified: 2013-04-08 03:40 UTC (History)
1 user (show)

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

glib-2.17.log.gz (sys-libs:glibc-2.17:20130116-044419.log.gz,411.87 KB, application/x-gzip)
2013-01-16 14:06 UTC, William Throwe

Note You need to log in before you can comment on or make changes to this bug.
Description William Throwe 2012-09-13 03:23:55 UTC
After upgrading to the new stable glibc, various programs have started segfaulting.  The ones I have noticed so far are ssh, groff, and fsck.ext3.  ssh was fixed by a rebuild of net-misc/openssh, but sys-apps/groff fails because the new groff binary it produces segfaults.  I have not attempted to rebuild sys-fs/e2fsprogs yet.

A few other packages were upgraded at the same time as glibc, but none of them are linked against by groff, so they seem unlikely to be the problem.

stracing the bad binaries does not reveal any pattern.  I do not have debugging symbols available, so gdb backtraces do not reveal too much, but many of them report stack corruption.

$ emerge --info glibc
Portage (default/linux/arm/10.0, gcc-4.5.3, glibc-2.15-r2, armv7l)
                        System Settings
System uname: Linux-
Timestamp of tree: Wed, 12 Sep 2012 06:45:01 +0000
distcc 3.1 armv7a-hardfloat-linux-gnueabi [enabled]
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.27
sys-apps/baselayout:      2.1-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo
CFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
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"
CXXFLAGS="-O2 -pipe -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distcc ebuild-locks fixlafiles news parse-eapi-ebuild-head protect-owned sandbox sfperms skiprocheck strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--no-keep-memory,--reduce-memory-overheads"
MAKEOPTS="-j5 -l2"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X acl arm berkdb bindist bzip2 cairo cli cracklib crypt cxx emacs fortran gdbm gpm gtk iconv jpeg latex modules mudflap ncurses nptl openmp pam pcre png pppd readline session ssl system-sqlite tcpd truetype unicode zlib" 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap omapfb dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

                        Package Settings

sys-libs/glibc-2.15-r2 was built with the following:
USE="-debug -gd (-hardened) (-multilib) -profile (-selinux) -vanilla"
CFLAGS="-pipe -march=armv7-a -mfpu=vfpv3 -O2 -fno-strict-aliasing"
CXXFLAGS="-pipe -march=armv7-a -mfpu=vfpv3 -O2 -fno-strict-aliasing"
Comment 1 William Throwe 2013-01-14 04:35:09 UTC
Finally got around to investigating this some more.  The problem persists with glibc 2.15-r3, but goes away with USE=vanilla, so this is caused by one of Gentoo's patches.

Unfortunately, with 68 patches and glibc taking a few hours to build, I'm not sure when I'll have the time to determine which one is the problem.
Comment 2 Steev Klimaszewski (RETIRED) gentoo-dev 2013-01-14 20:06:31 UTC
Hi William,

Which EfikaMX are you having this issue on (is it a smarttop or a smartbook, if smarttop is it a TO2 or a TO3?)  I can't reproduce this issue here at all, but I don't think I have a smartbook around that had a 2.14 glibc that was upgraded to 2.15, they are all done with newer stages that started with a 2.15 glibc.
Comment 3 SpanKY gentoo-dev 2013-01-15 03:32:24 UTC
(In reply to comment #1)

so try glibc-2.17
Comment 4 William Throwe 2013-01-15 03:51:58 UTC
(In reply to comment #2)
> Hi William,
> Which EfikaMX are you having this issue on (is it a smarttop or a smartbook,
> if smarttop is it a TO2 or a TO3?)  I can't reproduce this issue here at
> all, but I don't think I have a smartbook around that had a 2.14 glibc that
> was upgraded to 2.15, they are all done with newer stages that started with
> a 2.15 glibc.

My machine is a smartbook.

(In reply to comment #3)
> (In reply to comment #1)
> so try glibc-2.17

Will do.  Might take me a few days.
Comment 5 William Throwe 2013-01-16 14:06:18 UTC
Created attachment 335820 [details]

glibc-2.17 fails a preinst sanity check:

/bin/date: error while loading shared libraries: cannot open shared object file: No such file or directory
 * ERROR: sys-libs/glibc-2.17 failed (preinst phase):
 *   simple run test (/bin/date) failed

Let me know if I should file a separate bug for this.
Comment 6 SpanKY gentoo-dev 2013-01-23 05:22:40 UTC
(In reply to comment #5)

yes, that's a different bug.  please file a new report.
Comment 7 William Throwe 2013-01-24 03:31:09 UTC
(In reply to comment #6)
> (In reply to comment #5)
> yes, that's a different bug.  please file a new report.

Filed as bug #453760.
Comment 8 William Throwe 2013-03-05 05:12:33 UTC
Alright, I think I've sort of figured this out.

I ran a binary search on the patches, and everything seems to work if I exclude just 6226_all_arm-glibc-2.15-hardfp.patch .  As far as I can tell, all this patch does is rename to and change its SONAME.

After recompiling again with the patch, I noticed that some libraries and executables have NEEDED entries for, and when run with the new many of them segfault.  I do not know why these aren't just failing at runtime link because the SONAME of ld-linux changed, but they aren't.  This is presumably also why revdep-rebuild doesn't detect them.

One of these libraries is  Installing a newer slot of gcc (so the newer is used) makes groff stop segfaulting.  The openssh executables have the NEEDED entry, and remerging openssh makes them stop segfaulting.  It looks like the problem will be solved if I reinstall everything with NEEDED entries for

Assuming that works, I'm not sure if this bug is worth tracking down any further.  If anyone wants to, I'm happy to provide any information they need, but if not feel free to close the bug.  (I'll reopen if recompiling things doesn't fix it.)  I won't have time to recompile everything until this weekend, so if you want more information try to ask before then.  (And it seems that I can duplicate the problem with new executables by using a copy of the old, so I can give some help afterwards using that.)
Comment 9 SpanKY gentoo-dev 2013-04-08 03:40:52 UTC
(In reply to comment #8)

yes, what you describe sounds logical.  if you try to load the same ELF multiple times, things will probably crash.

things continue to work because the system installs a symlink from the old ldso name to the new ldso name in /lib/.

the only real fix is to rebuild everything.  this is a one time penalty and doesn't affect too many people.