Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 763585 - app-arch/tar: USE=static breaks every time glibc upgrades (was: glibc causes tar to Segmentation fault in NSS)
Summary: app-arch/tar: USE=static breaks every time glibc upgrades (was: glibc causes ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-04 21:29 UTC by Nuno
Modified: 2021-01-04 22:40 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno 2021-01-04 21:29:39 UTC
I was upgrading my @system set (using 'emerge --deep --update @system') and, after glibc was upgraded, the next package failed to emerge:

>>> Installing (32 of 66) dev-lang/python-3.9.0::gentoo                                                                                                                                                
>>> Emerging (33 of 66) sys-libs/glibc-2.32-r3::gentoo
>>> Installing (33 of 66) sys-libs/glibc-2.32-r3::gentoo                                                                                                                                               
>>> Emerging (34 of 66) dev-lang/python-3.7.9::gentoo                                                                                                                                                  
>>> Failed to emerge dev-lang/python-3.7.9, Log file:                                                                                                                                                  
>>>  '/var/tmp/portage/dev-lang/python-3.7.9/temp/build.log'                                                                                                                                           
>>> Jobs: 33 of 66 complete, 1 failed               Load avg: 2.69, 4.09, 2.83                     

 * Messages for package sys-libs/glibc-2.32-r3:

 * Applying Gentoo Glibc Patchset 2.32-2

 * Messages for package dev-lang/python-3.7.9:

 * ERROR: dev-lang/python-3.7.9::gentoo failed (unpack phase):
 *   unpack: failure unpacking Python-3.7.9.tar.xz


Upon investigating, I noticed tar is crashing with SIGSEGV. Here's a snippet of running it with gdb:

Starting program: /bin/tar xzf a.tar.gz
[Detaching after fork from child process 22347]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ad1270 in __nss_readline () from /lib64/libc.so.6



I noticed the same happens with rsync:

(gdb) run -av a/ b/
Starting program: /usr/bin/rsync -av a/ b/
[Detaching after fork from child process 21016]
sending incremental file list

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7aa9270 in __nss_readline () from /lib64/libc.so.6


Note that both rsync and tar are built with USE=static.

My first guess would be to try recompiling tar, but I can't emerge packages with a broken tar :/

The reason I'm opening a bug report is because this may be a glibc (ebuild?) bug, so I welcome suggestions for debugging this. Otherwise, I'll probably replace /bin/tar with busybox and try re-emerging tar.

I can provide further logs/info upon request.

Thanks in advance.

Reproducible: Didn't try




# genlop -u | grep glibc | tail -n2
     Fri Jan  1 14:31:40 2021 <<< sys-libs/glibc-2.31-r6
     Fri Jan  1 14:31:49 2021 >>> sys-libs/glibc-2.32-r3

# emerge --info net-misc/rsync app-arch/tar glibc
Portage 3.0.8 (python 3.7.8-final-0, default/linux/amd64/17.1/no-multilib/hardened, gcc-9.3.0, glibc-2.32-r3, 5.4.48-gentoo-minimal x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.4.48-gentoo-minimal-x86_64-Intel_Xeon_E312xx_-Sandy_Bridge,_IBRS_update-with-gentoo-2.7
KiB Mem:     9867560 total,   7289216 free
KiB Swap:   10485756 total,  10485756 free
Timestamp of repository gentoo: Fri, 01 Jan 2021 11:15:01 +0000
Head commit of repository gentoo: e47ebc6c160cad1de9f7484eabb0bd750d00d0e1
sh bash 5.0_p18
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.6.11-r2::gentoo, 3.7.8-r2::gentoo, 3.8.5::gentoo, 3.9.0::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.2-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo, 2.34-r2::gentoo
sys-devel/gcc:            5.5.0::gentoo, 6.5.0-r3::gentoo, 7.4.0-r2::gentoo, 7.5.0-r1::gentoo, 8.3.0-r1::gentoo, 8.4.0-r1::gentoo, 9.2.0-r2::gentoo, 9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://ftp.rnl.tecnico.ulisboa.pt/pub/gentoo/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.6/conf /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/apache2-php7.3/ext-active/ /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/php/cli-php7.4/ext-active/ /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=native"
DISTDIR="/var/db/repos/gentoo/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build --quiet-fail --jobs=1 --ask-enter-invalid --buildpkg-exclude 'virtual/* acct-user/* acct-group/* sys-kernel/*-sources rnl/*'"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH 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 binpkg-multi-instance buildpkg compressdebug 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 qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.rnl.tecnico.ulisboa.pt/pub/gentoo/gentoo-distfiles"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9 -l10"
PKGDIR="/var/db/repos/gentoo/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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="amd64 bash-completion bzip2 caps crypt hardened iconv ipv6 libglvnd libtirpc logrotate ncurses nls nptl openmp pam pcre pie readline seccomp split-usr ssl ssp unicode vim-syntax xattr xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2018" 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="mmx mmxext sse sse2 aes avx pclmul popcnt sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python3_8 python3_7" RUBY_TARGETS="ruby26" USERLAND="GNU" 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, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

net-misc/rsync-3.2.3::gentoo was built with the following:
USE="iconv ipv6 ssl static xattr -acl -examples -libressl -lz4 -stunnel -system-zlib -xxhash -zstd" CPU_FLAGS_X86="sse2"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -static"


app-arch/tar-1.32::gentoo was built with the following:
USE="nls static (xattr) -acl -minimal (-selinux)"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg compressdebug 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 splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -static"


sys-libs/glibc-2.32-r3::gentoo was built with the following:
USE="caps (crypt) multiarch nscd (ssp) (static-libs) -audit (-cet) -compile-locales -custom-cflags -doc -gd -headers-only (-multilib) -profile (-selinux) -static-pie -suid -systemtap -test (-vanilla)"
CFLAGS="-pipe -march=native -O2"
CXXFLAGS="-pipe -march=native -O2"
FEATURES="binpkg-docompress sfperms buildpkg protect-owned qa-unresolved-soname-deps unmerge-logs assume-digests usersandbox pid-sandbox sandbox unmerge-orphans multilib-strict fixlafiles userpriv network-sandbox distlocks binpkg-logs compressdebug binpkg-dostrip splitdebug unknown-features-warn binpkg-multi-instance ebuild-locks merge-sync ipc-sandbox news userfetch strict parallel-fetch xattr preserve-libs usersync config-protect-if-modified"
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2021-01-04 21:49:31 UTC
Yes, USE=static requires that programs not to use NSS facility (that requires dynamic library loading and has to match glibc versions at runtime and static link time).

In bug #741116 rsync lost USE=static precisely due to this problem.

If `tar` has no special provision to work in USE=static it should also not provide known-broken option. At a glance on the ebuild it does only `use static && append-ldflags -static` which is not enough.

Reassigning to base-system@ to remove USE=static.

To restore a system to working state I suggest you to pick working tar and rsync from a recent gentoo stage3 build.
Comment 2 Larry the Git Cow gentoo-dev 2021-01-04 22:40:41 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1766e2a34d57bf77074164320d0d417d3162f6ee

commit 1766e2a34d57bf77074164320d0d417d3162f6ee
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-01-04 22:37:26 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-01-04 22:37:26 +0000

    app-arch/tar: drop 'static' USE flag
    
    Closes: https://bugs.gentoo.org/763585
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 app-arch/tar/{tar-1.32.ebuild => tar-1.32-r1.ebuild}  | 15 +++++++--------
 .../tar/{tar-1.32.90.ebuild => tar-1.32.90-r1.ebuild} | 19 ++++++++++---------
 2 files changed, 17 insertions(+), 17 deletions(-)