Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 687174 - segfault in ld-2.29.so sys-libs/glibc-2.29-r2 when using emerge
Summary: segfault in ld-2.29.so sys-libs/glibc-2.29-r2 when using emerge
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-02 07:17 UTC by pararunner
Modified: 2019-06-09 10:44 UTC (History)
0 users

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


Attachments
debug (debug.txt,53.57 KB, text/plain)
2019-06-02 13:55 UTC, pararunner
Details
gdb (gdb,29.50 KB, text/plain)
2019-06-03 04:57 UTC, pararunner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pararunner 2019-06-02 07:17:45 UTC
Recent update of world with -NuD --with-bdeps=y was succesful. Now while merging there is segfault on start. 

dmesg shows:
[  388.432296] emerge[6163]: segfault at b0 ip 00007f5ff943e935 sp 00007fff754cded0 error 4 in ld-2.29.so[7f5ff9433000+26000]

Reproducible: Always

Steps to Reproduce:
1.install sys-libs/glibc-2.29-r2
2.update @world
3.merge smth
Actual Results:  
segfault

Expected Results:  
no segfault



Portage 2.3.66 (python 3.6.8-final-0, default/linux/amd64/17.0/desktop, gcc-9.1.0, glibc-2.29-r2, 5.0.2-gentooReiserMuqss.6 x86_64)
=================================================================
System uname: Linux-5.0.2-gentooReiserMuqss.6-x86_64-Intel-R-_Core-TM-_i5-2450M_CPU_@_2.50GHz-with-gentoo-2.6
KiB Mem:     8004648 total,   6466212 free
KiB Swap:    8077308 total,   8077308 free
Timestamp of repository gentoo: Sat, 01 Jun 2019 06:30:01 +0000
Head commit of repository gentoo: 680c7816bd6929e47015c125df41cad213c6187f
Timestamp of repository deadbeef-overlay: Sat, 18 May 2019 19:52:42 +0000
Head commit of repository deadbeef-overlay: 79579061afa631e2514d15a7088955ac09653393

Timestamp of repository palemoon: Sat, 11 May 2019 17:15:43 +0000
Head commit of repository palemoon: 9a3317ce727285305a512e4d007209dccf503fa7

sh sh
ld GNU ld (Gentoo 2.32 p2) 2.32.0
ccache version 3.7.1 [enabled]
app-shells/bash:          5.0_p7::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.16::gentoo, 3.6.8::gentoo
dev-util/ccache:          3.7.1::gentoo
dev-util/cmake:           3.14.4::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.17::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            8.3.0::gentoo, 9.1.0::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.0-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

gentoo
    location: /var/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24

deadbeef-overlay
    location: /var/db/repos/deadbeef-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/deadbeef-overlay.git
    masters: gentoo

palemoon
    location: /var/db/repos/palemoon
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/palemoon.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=sandybridge -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=sandybridge -O2 -pipe"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=2 --load-average=8 "
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="ru_RU.UTF8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru"
MAKEOPTS="-j2"
PKGDIR="/var/portage/packages"
PORTAGE_BINHOST="http://packages.gentooexperimental.org/packages/amd64-stable"
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 --exclude=/.git"
PORTAGE_TMPDIR="/tmp"
USE="a52 aac acl acpi alsa amd64 bash-completion berkdb branding bzip2 cairo cdr cli consolekit crypt cxx dbus dri dts dvd dvdr emboss encode exif fam ffmpeg flac fortran gdbm gif glamor gpm iconv idm jpeg lcms ldap libtirpc lock mad mmx mng mp3 mp4 mpeg multilib ncurses nls nptl nvidia ogg opengl openmp pam pango pcre pdf png policykit ppds sdl seccomp session spell sse sse2 ssl svg tcpd thunar tiff truetype udev udisks unicode upower urandom usb vaapi vorbis wxwidgets x264 xattr xcb xml xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="nvidia intel i965" XFCE_PLUGINS="clock trash power" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-06-02 07:43:12 UTC
1. Is emerge the only program you see crashing?
2. Can you get a backtrace off the crash? https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
3. Can you run 'LD_DEBUG=all emerge ...' and attach full log after a crash?
Comment 2 pararunner 2019-06-02 13:55:08 UTC
Created attachment 578404 [details]
debug
Comment 3 pararunner 2019-06-02 13:57:14 UTC
1. Yes, it is.
2. Can not figure out how to make that.
3. attached

New info:
I selected python-2.7.16 and succesfully re-emerged sys-libs/glibc-2.29-r2.
Then I turned back to python-3.6.8 and caught segfault.
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2019-06-02 16:52:23 UTC
(In reply to pararunner from comment #2)
> Created attachment 578404 [details]
> debug

(In reply to pararunner from comment #3)
> 1. Yes, it is.

Does it crash if you run emerge with --pretent argument? That might ease debugging if UID changes within emerge.

> 2. Can not figure out how to make that.

Usually session looks like like:

# ulimit -c unlimited
# <run a command>
# file core.${some-pid}
# gdb /path/to/failed/file core.${some-pid}
(gdb) bt
(gdb) disassemble

> 3. attached

Looks like that output is only for 'find' program'. Does not contain anything related to portage's internals.

> New info:
> I selected python-2.7.16 and succesfully re-emerged sys-libs/glibc-2.29-r2.
> Then I turned back to python-3.6.8 and caught segfault.
Comment 5 pararunner 2019-06-02 18:22:03 UTC
1. No crash if I run emerge with --pretent argument. 
2. core: ELF 64-bit LSB core file, x86-64, version 1 (SYSV), SVR4-style, from '/usr/bin/python3.6 -b /usr/lib/python-exec/python3.6/emerge portage', real uid: 0, effective uid: 0, real gid: 0, effective gid: 0, execfn: '/usr/lib/python-exec/python3.6/emerge', platform: 'x86_64'

In gdb:
"/var/log/core": not in executable format: формат файла не распознан
(gdb) bt
No stack.
(gdb) disassemble
No frame selected.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2019-06-02 19:20:49 UTC
(In reply to pararunner from comment #5)
> 1. No crash if I run emerge with --pretent argument. 
> 2. core: ELF 64-bit LSB core file, x86-64, version 1 (SYSV), SVR4-style,
> from '/usr/bin/python3.6 -b /usr/lib/python-exec/python3.6/emerge portage',
> real uid: 0, effective uid: 0, real gid: 0, effective gid: 0, execfn:
> '/usr/lib/python-exec/python3.6/emerge', platform: 'x86_64'
> 
> In gdb:
> "/var/log/core": not in executable format: формат файла не распознан
> (gdb) bt
> No stack.
> (gdb) disassemble
> No frame selected.

Oh, nice, you got the core dump! That's a good start.

Does that file permissions to read? gdb failed to read it for some reason.

gdb command should have been:

$ gdb /usr/bin/python3.6 ./core
(gdb) bt
(gdb) disassemble
Comment 7 pararunner 2019-06-03 04:57:24 UTC
Created attachment 578492 [details]
gdb
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2019-06-03 06:36:29 UTC
(In reply to pararunner from comment #7)
> Created attachment 578492 [details]
> gdb

Aha, good. It's a crash in python 3.6 somewhere around using ctypes library. The bug could be in many places.

To get backtrace with line numbers and variable values:

1. rebuild python and gibc wit debugging symbols enabled and unstripped: https://wiki.gentoo.org/wiki/Debugging_with_GDB. You need to add -ggdb to CFLAGS and disable stripping, something like following:
    CFLAGS="$(portageq envvar CFLAGS) -ggdb" LDFLAGS="$(portageq envvar LDFLAGS) -ggdb" FEATURES="nostrip" emerge -v1 glibc python:3.6
2. recreate core dump and run 'gdb bt' against it.
Comment 9 pararunner 2019-06-03 10:50:07 UTC
I selected python-2.7.16 and rebuild glibc and python-3.6.8. Then I turned back to python-3.6.8 and now I can't reproduce segfault. Python-3.6.8 was rebuilt without ncurses support. Maybe there was the bug.
What next?
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2019-06-03 20:33:28 UTC
Perhaps we have a subtle bug here when we miss some rebuild. Hard to say without a reproducer. What was the emerge order on you machine of the following packages?

$ qlop -lu glibc python libffi
Comment 11 pararunner 2019-06-04 12:21:36 UTC
Mon Jun  3 10:34:45 2019 <<< dev-lang/python-3.6.8
Mon Jun  3 10:35:02 2019 >>> dev-lang/python-3.6.8
Mon Jun  3 12:42:38 2019 <<< sys-libs/glibc-2.29-r2
Mon Jun  3 12:55:01 2019 >>> sys-libs/glibc-2.29-r2
Comment 12 Sergei Trofimovich (RETIRED) gentoo-dev 2019-06-05 06:29:28 UTC
(In reply to pararunner from comment #11)
> Mon Jun  3 10:34:45 2019 <<< dev-lang/python-3.6.8
> Mon Jun  3 10:35:02 2019 >>> dev-lang/python-3.6.8
> Mon Jun  3 12:42:38 2019 <<< sys-libs/glibc-2.29-r2
> Mon Jun  3 12:55:01 2019 >>> sys-libs/glibc-2.29-r2

This does not look like a complete emerge history. It has no previous versions of glibc, python and has no libffi at all.
Comment 13 pararunner 2019-06-05 08:49:34 UTC
Sun Aug  5 11:04:31 2018 <<< dev-lang/python-3.6.5-r1
Sun Aug  5 11:04:33 2018 >>> dev-lang/python-3.6.6
Mon Sep 10 09:54:04 2018 <<< sys-libs/glibc-2.27-r5
Mon Sep 10 09:54:07 2018 >>> sys-libs/glibc-2.27-r6
Mon Sep 10 16:23:40 2018 <<< sys-libs/glibc-2.27-r6
Mon Sep 10 16:23:46 2018 >>> sys-libs/glibc-2.28
Mon Oct  1 08:32:12 2018 <<< dev-libs/libffi-3.2.1-r2
Mon Oct  1 08:32:15 2018 >>> dev-libs/libffi-3.3_rc0
Fri Oct  5 07:56:53 2018 <<< virtual/libffi-3.0.13-r1
Fri Oct  5 08:10:31 2018 >>> virtual/libffi-3.3_rc0
Fri Oct  5 11:12:37 2018 <<< dev-lang/python-2.7.15
Fri Oct  5 11:12:40 2018 >>> dev-lang/python-2.7.15
Fri Oct  5 11:16:14 2018 <<< dev-lang/python-3.6.6
Fri Oct  5 11:16:17 2018 >>> dev-lang/python-3.6.6
Sat Nov 24 17:52:17 2018 <<< sys-libs/glibc-2.28
Sat Nov 24 17:52:26 2018 >>> sys-libs/glibc-2.28-r2
Sat Nov 24 18:43:04 2018 <<< dev-lang/python-2.7.15
Sat Nov 24 18:43:07 2018 >>> dev-lang/python-2.7.15
Sat Nov 24 18:46:36 2018 <<< dev-lang/python-3.6.6
Sat Nov 24 18:46:39 2018 >>> dev-lang/python-3.6.6
Sun Dec  2 17:47:03 2018 <<< sys-libs/glibc-2.28-r2
Sun Dec  2 17:47:13 2018 >>> sys-libs/glibc-2.28-r2
Sun Dec  2 20:40:18 2018 <<< dev-lang/python-3.6.6
Sun Dec  2 20:40:21 2018 >>> dev-lang/python-3.6.6
Sun Dec  2 20:42:51 2018 <<< dev-lang/python-2.7.15
Sun Dec  2 20:42:55 2018 >>> dev-lang/python-2.7.15
Mon Dec  3 10:30:08 2018 <<< dev-lang/python-2.7.15
Mon Dec  3 10:30:11 2018 >>> dev-lang/python-2.7.15
Mon Dec  3 11:12:01 2018 <<< dev-lang/python-3.6.6
Mon Dec  3 11:12:05 2018 >>> dev-lang/python-3.6.6
Thu Dec 27 09:44:01 2018 <<< sys-libs/glibc-2.28-r2
Thu Dec 27 09:44:09 2018 >>> sys-libs/glibc-2.28-r4
Thu Jan 10 22:46:31 2019 <<< dev-lang/python-2.7.15
Thu Jan 10 22:46:34 2019 >>> dev-lang/python-2.7.15
Fri Jan 18 10:32:52 2019 <<< dev-lang/python-3.6.6
Fri Jan 18 10:32:54 2019 >>> dev-lang/python-3.6.6
Fri Jan 18 14:29:13 2019 <<< sys-libs/glibc-2.28-r4
Fri Jan 18 14:29:21 2019 >>> sys-libs/glibc-2.28-r5
Fri Jan 18 15:27:47 2019 <<< dev-lang/python-3.6.6
Fri Jan 18 15:27:49 2019 >>> dev-lang/python-3.6.6
Fri Jan 18 15:30:24 2019 <<< dev-lang/python-2.7.15
Fri Jan 18 15:30:27 2019 >>> dev-lang/python-2.7.15
Tue Jan 22 12:34:03 2019 <<< dev-lang/python-3.6.6
Tue Jan 22 12:34:06 2019 >>> dev-lang/python-3.6.6
Tue Jan 22 12:36:38 2019 <<< dev-lang/python-2.7.15
Tue Jan 22 12:36:41 2019 >>> dev-lang/python-2.7.15
Wed Jan 30 15:13:59 2019 <<< dev-lang/python-3.6.6
Wed Jan 30 15:14:02 2019 >>> dev-lang/python-3.6.6
Wed Jan 30 15:17:50 2019 <<< dev-lang/python-2.7.15
Wed Jan 30 15:17:53 2019 >>> dev-lang/python-2.7.15
Thu Mar 14 19:44:48 2019 <<< dev-lang/python-3.6.6
Thu Mar 14 19:44:51 2019 >>> dev-lang/python-3.6.8
Thu Mar 14 19:47:11 2019 <<< dev-lang/python-2.7.15
Thu Mar 14 19:47:14 2019 >>> dev-lang/python-2.7.16
Thu Mar 14 20:41:17 2019 <<< sys-libs/glibc-2.28-r5
Thu Mar 14 20:41:25 2019 >>> sys-libs/glibc-2.28-r5
Mon Apr 29 16:12:53 2019 <<< sys-libs/glibc-2.28-r5
Mon Apr 29 16:13:03 2019 >>> sys-libs/glibc-2.29-r2
Sun Jun  2 12:10:12 2019 <<< sys-libs/glibc-2.29-r2
Sun Jun  2 12:22:18 2019 >>> sys-libs/glibc-2.29-r2
Sun Jun  2 18:43:07 2019 >>> dev-lang/python-3.7.3
Mon Jun  3 10:34:45 2019 <<< dev-lang/python-3.6.8
Mon Jun  3 10:35:02 2019 >>> dev-lang/python-3.6.8
Mon Jun  3 12:42:38 2019 <<< sys-libs/glibc-2.29-r2
Mon Jun  3 12:55:01 2019 >>> sys-libs/glibc-2.29-r2
Comment 14 Sergei Trofimovich (RETIRED) gentoo-dev 2019-06-09 10:44:34 UTC
I tried to reproduce the failure by ordering the updates followuing the same versions. Did not succeed breaking python.

Let's close it until we have better reproducer.