Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 815248 - net-fs/samba-4.15.0-r1: SEGV during linking
Summary: net-fs/samba-4.15.0-r1: SEGV during linking
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-28 17:04 UTC by Phil Stracchino (Unix Ronin)
Modified: 2022-01-24 14:00 UTC (History)
4 users (show)

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


Attachments
Build log (build.log.gz,223.10 KB, application/x-gzip-compressed)
2021-09-28 17:10 UTC, Phil Stracchino (Unix Ronin)
Details
Environment (environment,178.32 KB, text/plain)
2021-09-28 17:10 UTC, Phil Stracchino (Unix Ronin)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Stracchino (Unix Ronin) 2021-09-28 17:04:44 UTC
I am experiencing a consistent SEGV during linking when trying to update net-fs/samba 4.15.0-r1.  After multiple tries I was able to get 4.15.0 to build and install after deleting all manually specified USE flags except [client] (smbclient and mount.cifs are actually all I need), and stopping mysqld, firefox and thunderbird to maximize available memory.  I don't know whether it IS a memory issue or I just got lucky in that try.  I have yet to get 4.15.0-r1 to link successfully.

Reproducible: Always

Actual Results:  
[2005/3007] Linking bin/default/source3/modules/libvfs_module_io_uring.inst.so
[2006/3007] Compiling source3/modules/vfs_syncops.c
[2007/3007] Linking bin/default/source3/modules/libvfs_module_preopen.inst.so
collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.

collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.

collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.

Waf: Leaving directory `/var/tmp/portage/net-fs/samba-4.15.0-r1/work/samba-4.15.0-abi_x86_64.amd64/bin/default'
Build failed
 -> task in 'vfs_aio_pthread.inst' failed with exit status 1 (run with -v to display more information)
 -> task in 'vfs_gpfs.inst' failed with exit status 1 (run with -v to display more information)
 -> task in 'vfs_aio_fork.inst' failed with exit status 1 (run with -v to display more information)
 [31;01m*[0m ERROR: net-fs/samba-4.15.0-r1::gentoo failed (install phase):
 [31;01m*[0m   Make install failed



babylon5:root:~:5 # emerge --info
Portage 3.0.20 (python 3.9.6-final-0, default/linux/amd64/17.1/desktop, gcc-10.3.0, glibc-2.33-r1, 5.13.13-gentoo-babylon5 x86_64)
=================================================================
System uname: Linux-5.13.13-gentoo-babylon5-x86_64-AMD_Phenom-tm-_II_X6_1090T_Processor-with-glibc2.33
KiB Mem:    16393988 total,   4968720 free
KiB Swap:    8388604 total,   8108540 free
Timestamp of repository gentoo: Tue, 28 Sep 2021 06:00:01 +0000
Head commit of repository gentoo: b4dd8502a9b30982ea746f42e879745d9e87c228
Head commit of repository brother-overlay: b216154a0197486ec867d92bedf48aec7f958c9d

Head commit of repository mysql: 3925d2fe5eef1e63602a4f520028aa55dca3df08

sh bash 5.1_p8
ld GNU ld (Gentoo 2.36.1 p5) 2.36.1
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0-r2::gentoo
dev-lang/python:          3.9.6_p2::gentoo
dev-lang/rust-bin:        1.53.0::gentoo
dev-util/cmake:           3.21.3::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.43.5::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.4::gentoo
sys-devel/binutils:       2.36.1-r2::gentoo, 2.37_p1::gentoo
sys-devel/gcc:            10.3.0-r2::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://minbar.caerllewys.net/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1

brother-overlay
    location: /var/db/repos/brother-overlay
    sync-type: git
    sync-uri: https://github.com/stefan-langenmaier/brother-overlay.git
    masters: gentoo

gentoo-dev-alaric
    location: /var/lib/alaric
    masters: gentoo

mysql
    location: /var/db/repos/mysql
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/mysql.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe -mfpmath=sse -mcx16 -mpopcnt"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind /var/lib/hsqldb"
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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=amdfam10 -O2 -pipe -mfpmath=sse -mcx16 -mpopcnt"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --verbose-conflicts --keep-going"
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 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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org                 http://www.gtlib.gatech.edu/pub/gentoo                 http://mirrors.cs.wmich.edu/gentoo                 http://distfiles.gentoo.org                 "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US en"
MAKEOPTS="-j12"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 bash-completion branding bzip2 cairo cdda cddb cdr cli crypt cups dbus dri dts dvd dvdr elogind emboss encode exif ffmpeg flac fltk fortran gdbm gif gpm gtk gui iconv icu id3tag imagemagick ipv6 java jpeg jpeg2k lcms libglvnd libnotify libtirpc mad mmx mmxext mng mp3 mp4 mpeg multilib mysql ncurses nls nptl nsplugin nvidia ogg opengl openmp opus pam pango pcre pcsc-lite pdf png policykit ppds qt5 readline sdl seccomp spell split-usr sse sse2 sse4 ssl startup-notification svg theora threads tiff tk tools truetype udev udisks unicode upower usb utils v4l v4l2 vdpau vorbis vpx wxwidgets x264 xattr xcb xml xpm xv xvid xvmc zlib" ABI_X86="64" ADA_TARGET="gnat_2019" ALSA_CARDS="emu10k1 hda-intel" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" 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="evdev keyboard mouse" KERNEL="linux" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="nvidia v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

babylon5:root:~:6 # emerge -pqv '=net-fs/samba-4.15.0-r1::gentoo'
[ebuild     U ] net-fs/samba-4.15.0-r1 [4.15.0] USE="acl client cups pam regedit system-mitkrb5 -addc -ads -ceph -cluster -debug (-dmapi) (-fam) -glusterfs -gpg -iprint -json -ldap -profiling-data -python -quota (-selinux) -snapper -spotlight -syslog (-system-heimdal) -systemd (-test) -winbind -zeroconf" ABI_X86="(64) -32 (-x32)" PYTHON_SINGLE_TARGET="python3_9 -python3_8"

babylon5:root:~:7 # equery uses net-fs/samba-4.15.0-r1
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for net-fs/samba-4.15.0-r1:
 U I
 - - abi_x86_32                     : 32-bit (x86) libraries
 + + acl                            : Add support for Access Control Lists
 - - addc                           : Enable Active Directory Domain Controller support
 - - ads                            : Enable Active Directory support
 - - ceph                           : Enable support for Ceph distributed filesystem via
                                      sys-cluster/ceph
 + - client                         : Enables the client part
 - - cluster                        : Enable support for clustering
 + + cups                           : Add support for CUPS (Common Unix Printing System)
 - - debug                          : Enable extra debug codepaths, like asserts and extra
                                      output. If you want to get meaningful backtraces see http
                                      s://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtr
                                      aces
 - - glusterfs                      : Enable support for Glusterfs filesystem via
                                      sys-cluster/glusterfs
 - - gpg                            : Use app-crypt/gpgme for AD DC
 - - iprint                         : Enabling iPrint technology by Novell
 - - json                           : Enable json audit support through dev-libs/jansson
 - - ldap                           : Add LDAP support (Lightweight Directory Access Protocol)
 + + pam                            : Add support for PAM (Pluggable Authentication Modules) -
                                      DANGEROUS to arbitrarily flip
 - - profiling-data                 : Enables support for collecting profiling data
 - - python                         : Add optional support/bindings for the Python language
 - - python_single_target_python3_8 : Build for Python 3.8 only
 + + python_single_target_python3_9 : Build for Python 3.9 only
 - - quota                          : Enables support for user quotas
 + - regedit                        : Enable support for regedit command-line tool
 - - snapper                        : Enable vfs_snapper module (requires sys-apps/dbus)
 - - spotlight                      : Enable support for spotlight backend
 - - syslog                         : Enable support for syslog
 + - system-mitkrb5                 : Use app-crypt/mit-krb5 instead of app-crypt/heimdal.
 - - systemd                        : Enable use of systemd-specific libraries and features
                                      like socket activation or session tracking
 - - winbind                        : Enables support for the winbind auth daemon
 - - zeroconf                       : Support for DNS Service Discovery (DNS-SD)
Comment 1 Phil Stracchino (Unix Ronin) 2021-09-28 17:10:09 UTC
Created attachment 741786 [details]
Build log
Comment 2 Phil Stracchino (Unix Ronin) 2021-09-28 17:10:39 UTC
Created attachment 741789 [details]
Environment
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2021-09-28 17:50:17 UTC
Sometimes such segfaults stem from hardware errors. In my experience it was always faulty RAM that caused such segfaults.
Comment 4 Ben Kohler gentoo-dev 2021-09-28 17:59:05 UTC
Try forcing MAKEOPTS="-j1" and see if you can get it to consistently segfault at the exact same place.

If it's consistent, we may have some code bug.  If it's not, then you probably have failing hardware.
Comment 5 Phil Stracchino (Unix Ronin) 2021-09-28 18:34:24 UTC
Already brought it down to -j2.  Rerunning with -j1 now.  I note that nothing ELSE is experiencing any issues whatsoever that would be suggestive of a hardware problem.
Comment 6 Phil Stracchino (Unix Ronin) 2021-09-28 20:05:35 UTC
And the update is, even with -j1, it ALWAYS fails with a SIGSEGV during linking, but the precise *location* where it fails varies.  The last three attempts were:

[2007/3007] Linking bin/default/source3/modules/libvfs_module_preopen.inst.so
collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.


[1946/3007] Linking bin/default/source3/libsmbd-base-samba4.inst.so
collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.


[2095/3007] Linking bin/default/nsswitch/libnss-wrapper-winbind.so
collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.


Again, though, nothing EXCEPT this compile is failing.  Kernels?  No problem.  LibreOffice?  No problem.  MariaDB?  No problem.  Watching as it goers, I'm also not seeing any low-memory conditions or swap usage, so I think I was barking up the wrong tree trying to maximize free memory previously and just plan *got lucky* on the one 4.15.0 compile that DID succeed.

Can you think of anything else that could be causing repeated random SEGVs during link *in only this one package*?


(And with one more attempt it just randomly succeeded again.)
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-28 20:08:54 UTC
(In reply to Phil Stracchino (Unix Ronin) from comment #6)
> And the update is, even with -j1, it ALWAYS fails with a SIGSEGV during
> linking, but the precise *location* where it fails varies.  The last three
> attempts were:
> 

This is a bit scary and I think it implies you need to do a memtest just in case.

Ideally, it'd be the same place every time for us to call it a linker bug. Still
possible though.

> Again, though, nothing EXCEPT this compile is failing.  Kernels?  No
> problem.  LibreOffice?  No problem.  MariaDB?  No problem.  Watching as it
> goers, I'm also not seeing any low-memory conditions or swap usage, so I
> think I was barking up the wrong tree trying to maximize free memory
> previously and just plan *got lucky* on the one 4.15.0 compile that DID
> succeed.
> 
> Can you think of anything else that could be causing repeated random SEGVs
> during link *in only this one package*?
> 
> 
> (And with one more attempt it just randomly succeeded again.)

To be clear, this is essentially one of two things (modulo wild kernel bugs or whatever):
- hardware issues (like bad RAM, usually)
or
- a bug in the linker (binutils' ld) or gcc (the compiler producing something corrupted or bailing out?)

The only way this is going to be specific to Samba is that it happens to generate things which trip over whatever linker/??? bug that might exist. So, not the fault of Samba, but it's useful because it's reproducibleish.

We have https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide for GCC ICEs but it's somewhat similar for linker bugs (we should write up something similar), but let's get you to do a memtest first.
Comment 8 Phil Stracchino (Unix Ronin) 2021-09-28 20:15:03 UTC
Oh, wait!  I spoke too soon.  I didn't read closely enough; the SEGV is happening during the INSTALL phase, not the compile phase.  It did in fact fail again.

[2030/3007] Linking bin/default/source3/modules/libvfs_module_shell_snap.inst.so
[2031/3007] Compiling source3/modules/vfs_virusfilter_clamav.c
collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.

It never seems to fail at the same location twice in a row, but it is always late in this set of 3007 operations.



I will run a memtest when opportunity permits and report back.  I can't guarantee when I will get to it.
Comment 9 Phil Stracchino (Unix Ronin) 2021-11-03 15:24:29 UTC
I haven't gotten an opportunity to run a memtest yet.  I did successfully get it to downgrade to 4.14.9 yesterday ...   once.  Then a dependency forced a rebuild and it's failing in the install phase with a SEGV while linking again.

Now I'm not the world's greatest expert on samba, but it seems to me one elephant-in-the-middle-of-the-room question here is, why does this ebuild perform a SECOND round of compiling and linking in the *install* phase?  Isn't that, like supposed to be done in ... you know ... the *compile* phase?

The SEGV in link still seems to be completely random.  I just tried it again this morning.  It failed twice in a row, then succeeded.  Absolutely NOTHING else is failing.  I just recompiled binutils and binutils-libs (both 2.37_p1) out of constructive paranoia, but it seems suspicious to me that only net-fs-samba is failing and only net-fs/sambas is doing compile/link operations during the install phase, when surely it should be doing nothing but copy files.  Sorry to repeat myself, but is it really SUPPOSED to be doing that?

I really have a hard time believing that a machine that has been bombproof-stable for years would suddenly develop a memory issue that causes only one single package to consistently fail but doesn't affect anything else.  It stretches coincidence too far.  If some memory location has become that unreliable, it should be showing up in other things — not least in building gcc, which has ALWAYS been an excellent memory-system stress-test — and it isn't.


(And the only part I even *WANT* is smbclient...)

(USE flags:  client -cups -regedit)
Comment 10 Mathy Vanvoorden 2021-11-18 23:23:05 UTC
Just chiming in here: experiencing exactly the same thing with 4.14.9. Because of the errors I was seeing I was already thinking hardware and/or toolchain issues but then I recompiled gcc, glibc and binutils just to be sure (all without a hitch). My system is completely up-to-date except for samba now. If it was just one user I'd say probably still hardware, but now we're with two?



Portage 3.0.28 (python 3.9.8-final-0, default/linux/amd64/17.1, gcc-11.2.0, glibc-2.33-r7, 5.10.76-gentoo-r1-x86_64 x86_64)
=================================================================
System uname: Linux-5.10.76-gentoo-r1-x86_64-x86_64-AMD_FX-tm-6100_Six-Core_Processor-with-glibc2.33
KiB Mem:    16380040 total,    411588 free
KiB Swap:    8388592 total,   8388068 free
Timestamp of repository gentoo: Thu, 18 Nov 2021 22:30:01 +0000
Head commit of repository gentoo: a433febd1f556860488ba61257fc2bb59660d036
sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.34.0-r3::gentoo
dev-lang/python:          3.8.10_p2::gentoo, 3.9.8::gentoo
dev-util/cmake:           3.20.5::gentoo
sys-apps/baselayout:      2.7-r3::gentoo
sys-apps/openrc:          0.44.8::gentoo
sys-apps/sandbox:         2.25::gentoo
sys-devel/autoconf:       2.69-r5::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.16.4::gentoo
sys-devel/binutils:       2.35.2::gentoo, 2.37_p1::gentoo
sys-devel/gcc:            10.3.0::gentoo, 11.2.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r7::gentoo
Repositories:

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

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=amdfam10"
CHOST="x86_64-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 -pipe -march=amdfam10"
DISTDIR="/usr/portage/distfiles"
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 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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.leaseweb.com/gentoo/ ftp://gentoo.tiscali.nl/pub/mirror/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/var/cache/binpkgs"
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="acl amd64 bzip2 cli crypt dri fortran gdbm iconv ipv6 libglvnd libtirpc mmx multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr sse sse2 ssl unicode vaapi vdpau xattr zlib" ABI_X86="64 32" ADA_TARGET="gnat_2019" 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" 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" GRUB_PLATFORMS="pc" 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-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 11 Phil Stracchino (Unix Ronin) 2022-01-06 20:52:31 UTC
New discovery.  This actually appears to be related to ZRAM.

A while back I set up some zram swap.  I observed that it all seemed to be working fine, and didn't give it any further thought.

Then a few months ago I came to have a need for net-fs/samba again, which I hadn't had installed for a while.  That led to this ticket.

After a while of failing to be able to update it, with no solution in sight, I uninstalled it again and worked around the problem a different way.

A couple of days ago app-office/libreoffice started asking for a rebuild.  So I tried to rebuild it.  Three times.  Failing each time with the same sort-of-random ld SEGV I'd noticed with net-fs/samba.  Hmmmmm.  Curious.

Then I remembered zram.  And had a sneaky hunch.  So I turned off the zram swap and tried again.

app-office/libreoffice?  One and done.  net-fs/samba?  One and done.

I conclude that — possibly subject to details of zram configuration — zram MAY cause seemingly-random SEGVs during large link operations.
Comment 12 Phil Stracchino (Unix Ronin) 2022-01-24 14:00:14 UTC
OK, it wasn't ZRAM, because now 4.15.3-r1 is failing the same way.