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 220.127.116.11 (default/linux/arm/10.0, gcc-4.5.3, glibc-2.15-r2, 18.104.22.168.22-efikamx armv7l)
System uname: Linux-22.214.171.124.22-efikamx-armv7l-ARMv7_Processor_rev_5_-v7l-with-gentoo-2.1
Timestamp of tree: Wed, 12 Sep 2012 06:45:01 +0000
distcc 3.1 armv7a-hardfloat-linux-gnueabi [enabled]
dev-lang/python: 2.7.3-r2, 3.2.3
sys-devel/autoconf: 2.13, 2.68
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
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"
GENTOO_MIRRORS="http://gentoo.netnitco.net http://mirror.mcs.anl.gov/pub/gentoo/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://mirror.datapipe.net/gentoo ftp://mirror.datapipe.net/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--no-keep-memory,--reduce-memory-overheads"
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"
Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
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"
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.
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.
(In reply to comment #1)
so try glibc-2.17
(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.
Created attachment 335820 [details]
glibc-2.17 fails a preinst sanity check:
/bin/date: error while loading shared libraries: libgcc_s.so.1: 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.
(In reply to comment #5)
yes, that's a different bug. please file a new report.
(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.
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 ld-linux.so.3 to ld-linux-armhf.so.3 and change its SONAME.
After recompiling again with the patch, I noticed that some libraries and executables have NEEDED entries for ld-linux.so.3, and when run with the new ld-linux-armhf.so.3 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 libstdc++.so. Installing a newer slot of gcc (so the newer libstdc++.so 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 ld-linux.so.3.
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 ld-linux.so.3, so I can give some help afterwards using that.)
(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.