Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Updating to glibc-2.17 causes python and gcc to segfault
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
dennis.jenkins.75
n00b
n00b


Joined: 17 Apr 2012
Posts: 6

PostPosted: Wed Jan 29, 2014 5:38 pm    Post subject: Updating to glibc-2.17 causes python and gcc to segfault Reply with quote

Hello.

I have a Gentoo Linux system with glibc-2.16 installed. When attempting to update to glibc-2.17, the compile completes, but the system dies horribly during the install / removal of glibc-2.16. Python, gcc and other tools now segfault and I am unable to run commands like "emerge --info". Thankfully the system is a virtual machine and I was able to rollback to a snapshot. The underlying hardware is fine. I can move the VM to another system and get the same result. This is not a hardware problem (eg, bad RAM).

I have carefully updated everything on the system except for glibc, ran "python-updater", updated to kernel-3.10.25, etc... python and gcc seem to work just fine on glibc-2.16, and also on the previous kernel, 3.10.17. However, then I update glibc ("emerge -1v glibc" or "emerge -avuND world"), portage and the gcc tool chain segfault. I have duplicated this behavior multiple times over the past few weeks.

I would like to know how to update this system without breaking it. I have 40+ other Gentoo Linux virtual machines to update after this one, and I suspect that the others will suffer the same fate. They were all originally clones of a single Gentoo VM from years ago. Generally, Gentoo updates are applied weekly, so these systems are not stale.

In reading the output from the build of glibc-2.17, it looks like the system also trying to do something with glibc-2.16, as it encourages me to post the output of "emerge --info =glibc-2.16". I included the output of "emerge --info" for both glibc's below.

Also below I have included some portage diagnostic information from BEFORE it breaks. I will also show the breakage:

Thank you for your time and thoughts.

Code:

server ~ # emerge -vuND world

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-libs/glibc-2.17:2.2 [2.16.0:2.2] USE="-debug -gd (-hardened) (-multilib) -nscd% -profile (-selinux) -suid -systemtapanilla" 0 kB

Total: 1 package (1 upgrade), Size of downloads: 0 kB


>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-libs/glibc-2.17
 * glibc-2.17.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                            [ ok
 * glibc-2.17-patches-8.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                 [ ok
make -j7 -l3 -s glibc-test
make -j7 -l3 -s glibc-test
>>> Unpacking source...
 * Checking gcc for __thread support ...                                                                                             [ ok
 * Checking kernel version (3.10.17 >= 2.6.16) ...                                                                                   [ ok

(lots of output removed for brevity)
Code:

--- replaced obj /etc/host.conf
--- replaced obj /etc/gai.conf
--- replaced obj /etc/env.d/00glibc
--- replaced dir /etc/env.d
--- replaced dir /etc
<<<          dir /usr/share/doc/glibc-2.16.0
--- !empty   dir /usr/lib/tmpfiles.d
--- !empty   dir /usr/lib/systemd/system
--- !empty   dir /usr/lib/systemd
--- !empty   dir /etc/init.d
/usr/lib/portage/bin/phase-functions.sh: line 87:  3582 Segmentation fault      "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}"
 * ERROR: sys-libs/glibc-2.16.0::gentoo failed (postrm phase):
 *   filter-bash-environment.py failed
 *
 * Call stack:
 *            ebuild.sh, line 480:  Called __preprocess_ebuild_env
 *   phase-functions.sh, line 156:  Called __filter_readonly_variables '--filter-features' '--filter-locale' '--filter-path' '--filter-sandbox'
 *   phase-functions.sh, line 137:  Called die
 * The specific snippet of code:
 *      "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"
 *
 * If you need support, post the output of `emerge --info '=sys-libs/glibc-2.16.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/glibc-2.16.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/._unmerge_/sys-libs/glibc-2.16.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/._unmerge_/sys-libs/glibc-2.16.0/temp/environment'.
 * Working directory: '/usr/lib/portage/pym'
 * S: '/var/tmp/portage/._unmerge_/sys-libs/glibc-2.16.0/work/glibc-2.16.0'
/usr/lib/portage/bin/isolated-functions.sh: line 109:  3660 Segmentation fault      "$PORTAGE_BIN_PATH"/ebuild-ipc exit 1
 * The ebuild phase 'postrm' has exited unexpectedly. This type of behavior
 * is known to be triggered by things such as failed variable assignments

server ~ # emerge --info '=sys-libs/glibc-2.17::gentoo'
Segmentation fault

server ~ #  uname -a
Linux gbh-mad-1 3.10.25-gentoo #1 SMP PREEMPT Wed Jan 29 09:28:17 CST 2014 i686 Intel(R) Xeon(R) CPU X5690 @ 3.47GHz GenuineIntel GNU/Linux

server ~ # gcc --version
Segmentation fault


I then rollback the VM to before the emerge:

Code:

server ~ # gcc --version
gcc (Gentoo 4.7.3-r1 p1.4, pie-0.5.5) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

server ~ # emerge -pqv '=sys-libs/glibc-2.16.0::gentoo'
[ebuild   R   ] sys-libs/glibc-2.16.0  USE="-debug -gd (-hardened) (-multilib) -profile (-selinux) -suid -systemtap -vanilla"

server ~ # emerge -pqv '=sys-libs/glibc-2.17::gentoo'
[ebuild     U ] sys-libs/glibc-2.17 [2.16.0] USE="-debug -gd (-hardened) (-multilib) -nscd% -profile (-selinux) -suid -systemtap -vanilla"


server ~ # emerge --info '=sys-libs/glibc-2.17::gentoo'
Portage 2.2.7 (default/linux/x86/13.0, gcc-4.7.3, glibc-2.16.0, 3.10.25-gentoo i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.10.25-gentoo-i686-Intel-R-_Xeon-R-_CPU_X5690_@_3.47GHz-with-gentoo-2.2
KiB Mem:     1034472 total,    930328 free
KiB Swap:     273100 total,    273100 free
Timestamp of tree: Wed, 29 Jan 2014 05:15:01 +0000
ld GNU ld (GNU Binutils) 2.21.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r3, 3.3.3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j7 -l3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cxx dri gdbm iconv jpeg modules ncurses nls nptl openmp pam pcre png readline session ssl tcpd unicode x86 zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="cgi actions alias auth_basic auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" 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 ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

Back to top
View user's profile Send private message
uraes
Tux's lil' helper
Tux's lil' helper


Joined: 28 Nov 2002
Posts: 135
Location: Estonia

PostPosted: Wed Mar 26, 2014 7:42 pm    Post subject: Reply with quote

Think I just hit the same problem. Live server ... :(
Back to top
View user's profile Send private message
dennis.jenkins.75
n00b
n00b


Joined: 17 Apr 2012
Posts: 6

PostPosted: Wed Mar 26, 2014 7:45 pm    Post subject: Reply with quote

We still have not resolved this issue on our end. Some of our systems will accept the glibc update just fine, but other systems become broken. For the time being, we've been going "emerge -avuND world --exclude glibc", but sooner or later we must figure out why this is breaking and fix it.

I have no idea what is happening. I updated a test system, ran "ulimit -c; gcc --version", copied the core file to a working system and examined it with gdb. The stack trace was useless, holding only one frame.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6097
Location: Dallas area

PostPosted: Wed Mar 26, 2014 7:54 pm    Post subject: Reply with quote

Highly unlikely that it's a glibc problem per se.

What version of python is running "eselect python show"
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
dennis.jenkins.75
n00b
n00b


Joined: 17 Apr 2012
Posts: 6

PostPosted: Wed Mar 26, 2014 7:57 pm    Post subject: Reply with quote

# eselect python show
python2.7

# eselect python list
Available Python interpreters:
[1] python2.7 *
[2] python3.3

# equery l python
* Searching for python ...
[IP-] [ ] dev-lang/python-2.7.5-r3:2.7
[IP-] [ ] dev-lang/python-3.3.3:3.3


Note: Most of the GCC tool chain will also segfault: gcc, gdb (I have not tested other tools)
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6097
Location: Dallas area

PostPosted: Wed Mar 26, 2014 8:35 pm    Post subject: Reply with quote

Quote:
Some of our systems will accept the glibc update just fine, but other systems become broken.


I don't see any obvious problems, and what you said in the quote leads me to believe
that there's something else going on other than glibc/gcc/python.

Are you compiling on each virtual machine?

If you compile glibc-2.17 on a machine that works and one that doesn't and compare the glibc's are they identical (cmp -l)
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
TomWij
Retired Dev
Retired Dev


Joined: 04 Jul 2012
Posts: 1553

PostPosted: Wed Mar 26, 2014 10:06 pm    Post subject: Reply with quote

These are the first reports I see for this; besides that, it has survived ~ just fine.

Given there is talked about "live server" and "VM"; could it be the case, that the both of you are using one or another specific (cloud) hosting? eg. Linode?

If that is the case, there might be something special about their processors or virtualization or so; and because of that, you might need to set something specific to fix that up.
Back to top
View user's profile Send private message
dennis.jenkins.75
n00b
n00b


Joined: 17 Apr 2012
Posts: 6

PostPosted: Wed Mar 26, 2014 11:18 pm    Post subject: Reply with quote

Our virtual machines are running VMWare ESXi 5.1.0 on a mix of Sun 6270-M2 blades (Xeon CPUs) and Sun X2200-M2s (AMD CPUs) on our private hardware. They are not hosted with a cloud vendor. Although the hardware is 64-bit capable, the VMs themselves are 32-bit kernel and 32-bit user-space.

I will rebuilt glibc-2.17 and run "cmp -l" as suggested and publish results within a few days.
Back to top
View user's profile Send private message
Lomendil
n00b
n00b


Joined: 22 Jan 2003
Posts: 16

PostPosted: Thu Apr 17, 2014 7:12 pm    Post subject: Not just VMs Reply with quote

I just ran into this when I was updating a regular server. No cloud or VM or anything. This one was very outdated. I initially had trouble updating binutils with compilation failing because fallocate64 was not found. Then I tried updating glibc, but that failed. I updated gcc first (to 4.7.3), then tried glibc again. That's the upgrade that broke things.

I'm going to try unpacking some stuff from a stage3 tarball and see if that gets me a working toolchain.
_________________
This is my .sig
Back to top
View user's profile Send private message
TomWij
Retired Dev
Retired Dev


Joined: 04 Jul 2012
Posts: 1553

PostPosted: Thu Apr 17, 2014 7:49 pm    Post subject: Reply with quote

Hmm, still odd to see this in 2.17 which works fine for most people; there were segfaults with 2.18, which were resolved in 2.19.

Can you try to do `emerge @preserved-rebuild` and `revdep-rebuild` to see if it is perhaps breakage due to linkage related incompatibility? If not, it might be worth trying glibc 2.19; though, I don't know how well that would run on a stable system and downgrading back from it is dangerous to impossible so take this last advice with a grain of salt. In other words; if glibc 2.19 breaks things worse, an extremely challenging downgrade or installing again might be necessary.
Back to top
View user's profile Send private message
Lomendil
n00b
n00b


Joined: 22 Jan 2003
Posts: 16

PostPosted: Thu Apr 17, 2014 8:02 pm    Post subject: Reply with quote

Python fails with a segmentation fault, so I can't run emerge. My attempt at fixing from stage3 failed as well; I'm going to have to fix it from an install CD. I'll try to keep track of what I can to see if I can come up with anything useful for debugging the problem.

I may have to wipe out that evidence to get the system running again, however.

EDIT: This has been resolved, it wasn't a problem with the toolchain per se. Somehow CHOST was changed from x86_64 to i686, so GCC was making libraries and executables that weren't compatible with the system. Using a livecd and unpacking some files from stage3 gave me a working system in chroot. Then it was a matter of re-emerging the broken packages.

Now to figure out who/what changed CHOST...
_________________
This is my .sig
Back to top
View user's profile Send private message
dennis.jenkins.75
n00b
n00b


Joined: 17 Apr 2012
Posts: 6

PostPosted: Wed Apr 30, 2014 3:18 pm    Post subject: Reply with quote

The above mentioned problem with installing the glibc-2.17 update appears to have disappeared. I have no hard evidence as to why.

For the past few months, I've been doing this to update our systems (because updating glibc would brick gcc + python):

"emerge -qvuND @world --keep-going --exclude glibc"

Over the past few days, I have been making VMWare snapshots, updating systems one at a time, testing, and rolling back if needed. Not a single system has been broken.

I can only assume that some other set of packages or system changes applied in the past three months has somehow affected this issue.

IF there is interest, I can restore an older copy of a nearly-blank Gentoo VM that exhibited the problem, scrub private data off of it and make the disk image available to a Gentoo glibc maintainer for experimentation. Since this is a bit of work for me, I won't do this unless someone is interested. This VM would have glibc-2.16 (working), but upon update to glibc-2.17, would break the system in the manner described in this thread. The problem VM in mind is only used for fetching the Gentoo portage tree via rsync, and building "gcc" as a binary package for quick install on our other Gentoo systems. I would necessarily need to nuke "/var/log", edit "/etc/make.conf", remove ssh keys (to protect the guilty) and zero out all free disk space. After doing these steps, I would test to ensure that the VM still exhibits the problem. The oldest backup of this VM that I have is from 2014-03-17.

Any interest? (ps- I can port the disk image to QEMU if that would help).


EDIT: Damn! Right after I post this I find a VM that still breaks when updating glibc. I am going to roll it back, clone it and begin cleaning up the clone. Hopefully someone will want a copy to experiment on.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum