Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 725674 - busybox in initramfs when build with CONFIG_STACK_OPTIMIZATION_386=y fails with Segmentation fault
Summary: busybox in initramfs when build with CONFIG_STACK_OPTIMIZATION_386=y fails wi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2020-05-28 01:42 UTC by Eric Gravel
Modified: 2020-08-27 18:08 UTC (History)
3 users (show)

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


Attachments
genkernel log of generated initramfs (genkernel.log.bz2,63.25 KB, application/x-bzip)
2020-05-28 01:47 UTC, Eric Gravel
Details
strace of busybox segmentation fault (strace_genkernel4_busybox.out,966 bytes, text/plain)
2020-05-28 01:48 UTC, Eric Gravel
Details
build log of Busybox with CONFIG_STACK_OPTIMIZATION_386=y (busybox-1.31.1-r2%3A20200824-185411.log,522.35 KB, application/octet-stream)
2020-08-24 19:19 UTC, Eric Gravel
Details
elog of Busybox (sys-apps%3Abusybox-1.31.1-r2%3A20200824-185633.log,1.27 KB, text/plain)
2020-08-24 19:21 UTC, Eric Gravel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Gravel 2020-05-28 01:42:43 UTC
The busybox binary integrated in the initramfs generated with genkernel does a segmentation fault when executed during boot or by its self when extracted from the initramfs.  

Error during boot:

traps: uname[198] general protection fault ip:80550bc sp:bfde498c error:0 in busybox[8049000+16c000]
traps: cut[201] general protection fault ip:80550bc sp:bfde498c error:0 in busybox[8049000+16c000]
traps: mknod[205] general protection fault ip:80550bc sp:bfde498c error:0 in busybox[8049000+16c000]
traps: mknod[206] general protection fault ip:80550bc sp:bfde498c error:0 in busybox[8049000+16c000] 

Segmentation fault when executed from extracted initramfs:

Gentoo ~/genkernel4_initramfs/bin # ./busybox uname -a
Linux Gentoo 5.4.38-gentoo #1 SMP Tue May 12 12:24:17 EDT 2020 i686 GNU/Linux
Segmentation fault
Gentoo ~/genkernel4_initramfs/bin #

This does not happen with the busybox binary from the /bin directory:

Gentoo ~ # /bin/busybox uname -a
Linux Gentoo 5.4.38-gentoo #1 SMP Tue May 12 12:24:17 EDT 2020 i686 i686 i386 GNU/Linux
Gentoo ~ #


Gentoo ~ # emerge --info
Portage 2.3.99 (python 3.7.7-final-0, default/linux/x86/17.0, gcc-9.3.0, glibc-2.30-r8, 5.4.38-gentoo i686)
=================================================================
System uname: Linux-5.4.38-gentoo-i686-Intel-R-_Xeon-R-_CPU_E5504_@_2.00GHz-with-gentoo-2.6
KiB Mem:     3109424 total,    197068 free
KiB Swap:     530428 total,    529652 free
Head commit of repository mv: 7c6c8d6d0cd811665ac38c2918216cef78a1040c

Head commit of repository spikyatlinux: 0de940c5f2c4b56b9d8240194f643db896adf606

Head commit of repository vmacs: 47c9f6a71b7ed85c63cb481c624ee7fc4892f565

Timestamp of repository gentoo: Wed, 27 May 2020 00:45:01 +0000
Head commit of repository gentoo: 20207419457c676f156e212bf03cf27982eea494
sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash:          5.0_p17::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.18::gentoo, 3.7.7-r2::gentoo, 3.8.2-r2::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo
Repositories:

mv
    location: /var/lib/layman/mv
    sync-type: git
    sync-uri: git://anongit.gentoo.org/user/mv.git
    masters: gentoo
    priority: 50

spikyatlinux
    location: /var/lib/layman/spikyatlinux
    sync-type: git
    sync-uri: https://github.com/spikyatlinux/ebuilds_for_gentoo.git
    masters: gentoo
    priority: 50

vmacs
    location: /var/lib/layman/vmacs
    sync-type: git
    sync-uri: git://anongit.gentoo.org/user/vmacs.git
    masters: gentoo
    priority: 50

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

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="@FREE"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind /var/spool/munin-async/.ssh"
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"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
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 -march=i686 -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 split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="rsync://gentoo.gossamerhost.com/gentoo-distfiles/ ftp://mirrors.tera-byte.com/pub/gentoo http://gentoo.mirrors.tera-byte.com/ rsync://mirrors.tera-byte.com/gentoo ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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 berkdb bzip2 cli crypt dri fortran gdbm iconv libtirpc logrotate ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl tcpd threads unicode x86 xattr zlib" ABI_X86="32" ADA_TARGET="gnat_2018" 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 cgid info rewrite status authz_host authn_core authz_core unixd dir mime alias include negotiation log_config log_forensic logio socache_shmcb setenvif headers" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="iptables apache bind apcupsd hddtemp df disk md memory mysql network ntpd rrdtool sensors smart cpu interface ethstat dns" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 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" 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" OFFICE_IMPLEMENTATION="libreoffice" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="account geoip iface ipmark"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Gentoo ~ #
Comment 1 Eric Gravel 2020-05-28 01:47:39 UTC
Created attachment 642130 [details]
genkernel log of generated initramfs
Comment 2 Eric Gravel 2020-05-28 01:48:46 UTC
Created attachment 642132 [details]
strace of busybox segmentation fault
Comment 3 Jonas Stein gentoo-dev 2020-05-31 17:20:06 UTC
It is sad to read that you have problems with the software. The situation seems to be a bit more complicate and requires some analysis.
We can not help you efficiently via bug tracker. The bug tracker aims rather on specific problems in .ebuilds and less on individual systems. 

I have had very good experience on the gentoo IRC [1] with questions like this. Of course there are also forums and mailing lists [2,3].
I hope you understand, that I will close the bug here therefore and wish you good luck on one of the mentioned channels [4].
Please reopen the ticket in order to provide an indication for an specific error in an ebuild or any gentoo related product.

[1] https://www.gentoo.org/get-involved/irc-channels/
[2] https://forums.gentoo.org/
[3] https://www.gentoo.org/get-involved/mailing-lists/all-lists.html
[4] https://www.gentoo.org/support/
Comment 4 Stephen Bell 2020-08-11 18:39:07 UTC
Eric, did you post on the forum or elsewhere about this?

In case not, I'll just make a brief note here that I think was causing this for me. 

/var/log/genkernel.log has a line

Use -mpreferred-stack-boundary=2 on i386 arch (STACK_OPTIMIZATION_386) [N/y/?] n

If I specify a custom busybox config in genkernel.conf created by taking the packaged busy-config and adding a line

CONFIG_STACK_OPTIMIZATION_386=n

then the generated busybox doesn't segfault, at least not on my system.
Comment 5 Eric Gravel 2020-08-12 01:19:43 UTC
(In reply to Stephen Bell from comment #4)
> Eric, did you post on the forum or elsewhere about this?
> 
> In case not, I'll just make a brief note here that I think was causing this
> for me. 
> 
> /var/log/genkernel.log has a line
> 
> Use -mpreferred-stack-boundary=2 on i386 arch (STACK_OPTIMIZATION_386)
> [N/y/?] n
> 
> If I specify a custom busybox config in genkernel.conf created by taking the
> packaged busy-config and adding a line
> 
> CONFIG_STACK_OPTIMIZATION_386=n
> 
> then the generated busybox doesn't segfault, at least not on my system.

Yes I did post in the forum about it.  Testing your solution right now.
Comment 6 Eric Gravel 2020-08-12 02:30:17 UTC
Thank you very much Stephen.  That solved my problem I was having.  Now why do I have to change that config on my 32 bit system and not on my 64 bit system?  Both are VMs running on the same ESXi host.  The 32bit VM was P2V from an old 32bit only physical server.   Both have CONFIG_STACK_OPTIMIZATION_386=y in the  /etc/portage/savedconfig/sys-apps/busybox-1.31.1-r2 file, that I guess is used when busybox is compiled with genkernel. Or that is not the case?
Comment 7 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-13 13:00:30 UTC
Genkernel doesn't use anything from host system except toolchain. That means genkernel doesn't copy already built sys-apps/busybox into initramfs -- genkernel will compile its own busybox. And while doing that, genkernel uses on CFLAGS and doesn't use portage's savedconfig feature because it isn't portage :)

What I don't understand yet is why CONFIG_STACK_OPTIMIZATION_386=y is failing for you.

@ Stephen: Could you please share your system and CPU details, too?
Comment 8 Stephen Bell 2020-08-13 20:35:39 UTC
It's this

System uname: Linux-5.4.48-gentoo-x86_64-x86_64-AMD_Ryzen_7_2700_Eight-Core_Processor-with-gentoo-2.6

but as you see it's running 64-bit at the moment. I'll reboot into 32-bit and run emerge --info once chromium has finished building (if that happens today).
Comment 9 Stephen Bell 2020-08-13 20:54:15 UTC
Portage 2.3.103 (python 3.7.8-final-0, default/linux/x86/17.0/desktop/gnome/systemd, gcc-9.3.0, glibc-2.30-r8, 5.4.48-gentoo-x86 i686)
=================================================================
System uname: Linux-5.4.48-gentoo-x86-i686-AMD_Ryzen_7_2700_Eight-Core_Processor-with-gentoo-2.6
KiB Mem:    32898532 total,  30959592 free
KiB Swap:    8385852 total,   8385852 free
Timestamp of repository gentoo: Thu, 13 Aug 2020 00:15:01 +0000
Head commit of repository gentoo: 59d5d32bc810eda4d31552bbc381becdce7ae23c
sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash:          5.0_p17::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.4-r1::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3::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.30-r8::gentoo
Repositories:

my_local_overlay
    location: /usr/local/portage
    masters: gentoo
    priority: 0

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

ikelos
    location: /var/lib/layman/ikelos
    masters: gentoo
    priority: 50

rich0
    location: /var/lib/layman/rich0
    masters: gentoo
    priority: 50

my-overlay
    location: /usr/local/overlays/my-overlay
    masters: gentoo
    priority: 100

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="@FREE"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/libreoffice/program/sofficerc /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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="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 -march=i686 -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 -march=i686 -pipe"
GENTOO_MIRRORS="ftp://mirror.bytemark.co.uk/gentoo/ ftp://gentoo.mirror.web4u.cz/ http://mirror.bytemark.co.uk/gentoo/ http://ftp.twaren.net/Linux/Gentoo/ rsync://mirror.bytemark.co.uk/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB en"
MAKEOPTS="-j9"
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="X a52 aac acl acpi alsa apache2 bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cli colord crypt cups dbus dri dts dvd dvdr eds emboss encode evo exif flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv icu introspection ipv6 jpeg lcms ldap libglvnd libnotify libsecret libtirpc mad mng mp3 mp4 mpeg nautilus ncurses networkmanager nls nptl nptlonly ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline sdl seccomp spell split-usr ssl startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode upower usb vorbis wxwidgets x264 x86 xattr xcb xml xprint xv xvid zlib" ABI_X86="32" ADA_TARGET="gnat_2018" 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="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="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" KERNEL="linux" L10N="en-GB en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="nouveau" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 10 Eric Gravel 2020-08-13 21:31:38 UTC
Here is a 2nd 32 bit system that I have that has the same issue.  This one is installed on a physical computer with a Core I7 950 CPU.

Portage 2.3.103 (python 3.7.8-final-0, default/linux/x86/17.0, gcc-9.3.0, glibc-2.30-r8, 4.19.86-gentoo i686)
=================================================================
System uname: Linux-4.19.86-gentoo-i686-Intel-R-_Core-TM-_i7_CPU_950_@_3.07GHz-with-gentoo-2.6
KiB Mem:     6145952 total,   4376804 free
KiB Swap:    2097144 total,   2096368 free
Head commit of repository mv: 0b62b96755582e3ea8c7dc3748f9c27b30a25a04

Timestamp of repository gentoo: Mon, 03 Aug 2020 00:45:01 +0000
Head commit of repository gentoo: 3c138d61b2d48824e7626dd92a98269e065babed
sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash:          5.0_p17::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.4-r1::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.12.6-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3::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.30-r8::gentoo
Repositories:

mv
    location: /var/lib/layman/mv
    sync-type: git
    sync-uri: git://anongit.gentoo.org/user/mv.git
    masters: gentoo
    priority: 50

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

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="@FREE"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=nehalem -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind /var/spool/munin-async/.ssh"
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"
CXXFLAGS="-O2 -march=nehalem -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
ENV_UNSET="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 -march=i686 -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 -march=i686 -pipe"
GENTOO_MIRRORS="rsync://gentoo.gossamerhost.com/gentoo-distfiles/ rsync://mirrors.tera-byte.com/gentoo ftp://mirrors.tera-byte.com/pub/gentoo ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en fr"
MAKEOPTS="-j8"
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 berkdb bindist bzip2 cli crypt dri fortran gdbm iconv icu libtirpc logrotate ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl tcpd threads unicode x86 xattr zlib" ABI_X86="32" ADA_TARGET="gnat_2018" 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="filter deflate headers expires cgi cgid info rewrite status authz_host authn_core authz_core unixd dir mime alias include negotiation log_config log_forensic logio socache_shmcb setenvif" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 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" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" SANE_BACKENDS="snapscan" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="account geoip iface ipmark"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 11 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-14 12:20:13 UTC
I am not sure what to do here. I cannot reproduce. I tested on *real* i686-only hardware like Intel(R) Atom(TM) CPU N550 and Pentium 4 (Prescott) -- both systems booted with kernel/initramfs created by genkernel-4.1.0 (and yes, CONFIG_STACK_OPTIMIZATION_386=y was automatically set busybox).

I also booted multiple x86 virtual machines on various modern Intel- and AMD-based hosts using different hypervisors (VMware, HypverV..).

So I don't feel comfortable to force CONFIG_STACK_OPTIMIZATION_386=n for everyone just because of 2 reports from people not even using real x86 hardware (please don't get me wrong on this).
Comment 12 Stephen Bell 2020-08-14 21:42:12 UTC
I'm ok. I'm only keeping an x86 system for... sentimental reasons and I have a workaround for this problem anyway.
Comment 13 Eric Gravel 2020-08-15 02:14:57 UTC
Sorry for my ignorance, but what does the option CONFIG_STACK_OPTIMIZATION_386=y do?
Comment 14 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-15 11:14:16 UTC
See http://lists.busybox.net/pipermail/busybox-cvs/2018-April/037958.html
Comment 15 Stejarel Veres 2020-08-22 23:42:22 UTC
I am seeing the same issue under similar circumstances (x86 VM running in VMware on a Core i7.) Disabling CONFIG_STACK_OPTIMIZATION_386 works for me as well.
Comment 16 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-22 23:46:39 UTC
Could anyone experiencing this problem please report to busybox upstream and report back link to that mail/bug report?
Comment 17 Stephen Bell 2020-08-23 17:47:37 UTC
Busybox maintainer gave their view at https://lists.debian.org/debian-boot/2018/01/msg00352.html on a discussion from early 2018 about the debian version of this problem. If I'm reading it correctly (not a given, I don't understand the issue), it looks like the CONFIG_STACK_OPTIMIZATION_386 option _is_ the upstream fix to the issue. 

Original debian bug report here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886506;msg=97.
Comment 18 Larry the Git Cow gentoo-dev 2020-08-23 20:16:11 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=064a2d9f2d6e6d4c5b5f2b04464c767387ef4f6c

commit 064a2d9f2d6e6d4c5b5f2b04464c767387ef4f6c
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-08-23 20:15:29 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-08-23 20:15:41 +0000

    busy-config: Disable CONFIG_STACK_OPTIMIZATION_386
    
    Using '-mpreferred-stack-boundary=2' is considered broken and
    is causing problems for some users.
    
    Bug: https://bugs.gentoo.org/725674
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 defaults/busy-config | 1 +
 1 file changed, 1 insertion(+)
Comment 19 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-23 20:21:52 UTC
I am really wondering what is triggering this. Also, is the binary always broken or just in initramfs environment? It would be helpful if some advanced user who is able to reproduce could rebuild busybox with this option and debug symbols enabled to get a backtrace. Even "ip reported..." information would be helpful. We really need to see the failing instruction.

In the meanwhile I disable the option for now.
Comment 20 Eric Gravel 2020-08-24 19:19:51 UTC
Created attachment 656506 [details]
build log of Busybox with CONFIG_STACK_OPTIMIZATION_386=y

build log of Busybox with CONFIG_STACK_OPTIMIZATION_386=y but does not show -mpreferred-stack-boundary=2
Comment 21 Eric Gravel 2020-08-24 19:21:08 UTC
Created attachment 656508 [details]
elog of Busybox

elog of Busybox showing it is using /etc/portage/savedconfig/sys-apps/busybox-1.31.1-r2
Comment 22 Eric Gravel 2020-08-24 19:26:22 UTC
Hi Thomas, I am trying to get you the information you need, but for some reason when building Busybox  from Portage it seems to not take the /etc/portage/savedconfig/sys-apps/busybox-1.31.1-r2 config because I don't see '-mpreferred-stack-boundary=2' in the build log when 'CONFIG_STACK_OPTIMIZATION_386=y' is set.

Here is my portage busybox USE flags:
[ebuild   R    ] sys-apps/busybox-1.31.1-r2::gentoo  USE="debug savedconfig static -ipv6 -livecd -make-symlinks -math -mdev -pam (-selinux) -sep-usr -syslog -systemd" 0 KiB


With 'CONFIG_STACK_OPTIMIZATION_386=y' or 'CONFIG_STACK_OPTIMIZATION_386=n'. I have the same results.  No segmentation fault
Comment 23 Stephen Bell 2020-08-24 20:38:49 UTC
(In reply to Eric Gravel from comment #22)
> Hi Thomas, I am trying to get you the information you need, but for some
> reason when building Busybox  from Portage it seems to not take the
> /etc/portage/savedconfig/sys-apps/busybox-1.31.1-r2 config because I don't
> see '-mpreferred-stack-boundary=2' in the build log when
> 'CONFIG_STACK_OPTIMIZATION_386=y' is set.
> 
> Here is my portage busybox USE flags:
> [ebuild   R    ] sys-apps/busybox-1.31.1-r2::gentoo  USE="debug savedconfig
> static -ipv6 -livecd -make-symlinks -math -mdev -pam (-selinux) -sep-usr
> -syslog -systemd" 0 KiB
> 
> 
> With 'CONFIG_STACK_OPTIMIZATION_386=y' or 'CONFIG_STACK_OPTIMIZATION_386=n'.
> I have the same results.  No segmentation fault

See comment 7. The package build doesn't bypasses some of the busybox build systme and uses the portage compile flags.
Comment 24 Stephen Bell 2020-08-24 20:52:11 UTC
(In reply to Thomas Deutschmann from comment #19)
> I am really wondering what is triggering this. Also, is the binary always
> broken or just in initramfs environment? It would be helpful if some
> advanced user who is able to reproduce could rebuild busybox with this
> option and debug symbols enabled to get a backtrace. Even "ip reported..."
> information would be helpful. We really need to see the failing instruction.
> 
> In the meanwhile I disable the option for now.

It segfaults whether in initramfs or not.

Not an advanced user, and I wouldn't know how to get genkernel to build a debug busybox, but I used the bundled base 1.32 busybox archive, changed the .config to enable some of the debugging options, and got a debuggable busybox_unstripped. Running this in gdb with parameters "uname -a", I get

(gdb) run uname -a
Starting program: /tmp/bb/busybox-1.32.0/busybox_unstripped uname -a
Linux nova 5.4.57-gentoo-x86 #1 SMP PREEMPT Sun Aug 16 19:26:04 BST 2020 i686 GNU/Linux

Program received signal SIGSEGV, Segmentation fault.
0x08056108 in __run_exit_handlers ()

(gdb) backtrace
#0  0x08056108 in __run_exit_handlers ()
#1  0x08056371 in exit ()
#2  0x0812504d in xfunc_die () at libbb/xfunc_die.c:20
#3  0x081d9d23 in fflush_stdout_and_exit (retval=retval@entry=0) at libbb/fflush_stdout_and_exit.c:21
#4  0x081c3f8c in uname_main (argc=2, argv=0xbffff1a8) at coreutils/uname.c:212
#5  0x0812449b in run_applet_no_and_exit (applet_no=362, name=name@entry=0xbffff33e "uname", argv=argv@entry=0xbffff1a8) at libbb/appletlib.c:999
#6  0x081247b0 in run_applet_and_exit (name=0xbffff33e "uname", argv=argv@entry=0xbffff1a8) at libbb/appletlib.c:1017
#7  0x08124798 in busybox_main (argv=0xbffff1a8) at libbb/appletlib.c:960
#8  run_applet_and_exit (name=<optimized out>, argv=argv@entry=0xbffff1a4) at libbb/appletlib.c:1010
#9  0x0812483d in main (argc=3, argv=0xbffff1a4) at libbb/appletlib.c:1151
Comment 25 Stephen Bell 2020-08-24 20:57:05 UTC
> 
> It segfaults whether in initramfs or not.
> 
> Not an advanced user, and I wouldn't know how to get genkernel to build a
> debug busybox, but I used the bundled base 1.32 busybox archive, changed the
> .config to enable some of the debugging options, and got a debuggable
> busybox_unstripped. Running this in gdb with parameters "uname -a", I get
> 

Changes to .config after running make defconfig (not sure the CFLAGS change did anything).

@@ -41,7 +41,7 @@
 #
 # Build Options
 #
-# CONFIG_STATIC is not set
+CONFIG_STATIC=y
 # CONFIG_PIE is not set
 # CONFIG_NOMMU is not set
 # CONFIG_BUILD_LIBBUSYBOX is not set
@@ -50,7 +50,7 @@
 # CONFIG_FEATURE_SHARED_BUSYBOX is not set
 CONFIG_CROSS_COMPILER_PREFIX=""
 CONFIG_SYSROOT=""
-CONFIG_EXTRA_CFLAGS=""
+CONFIG_EXTRA_CFLAGS="-g"
 CONFIG_EXTRA_LDFLAGS=""
 CONFIG_EXTRA_LDLIBS=""
 # CONFIG_USE_PORTABLE_CODE is not set
@@ -71,7 +71,7 @@
 #
 # Debugging Options
 #
-# CONFIG_DEBUG is not set
+CONFIG_DEBUG=y
 # CONFIG_DEBUG_PESSIMIZE is not set
 # CONFIG_DEBUG_SANITIZE is not set
 # CONFIG_UNIT_TEST is not set
Comment 26 Eric Gravel 2020-08-24 22:27:34 UTC
(In reply to Stephen Bell from comment #23)
> (In reply to Eric Gravel from comment #22)
> > Hi Thomas, I am trying to get you the information you need, but for some
> > reason when building Busybox  from Portage it seems to not take the
> > /etc/portage/savedconfig/sys-apps/busybox-1.31.1-r2 config because I don't
> > see '-mpreferred-stack-boundary=2' in the build log when
> > 'CONFIG_STACK_OPTIMIZATION_386=y' is set.
> > 
> > Here is my portage busybox USE flags:
> > [ebuild   R    ] sys-apps/busybox-1.31.1-r2::gentoo  USE="debug savedconfig
> > static -ipv6 -livecd -make-symlinks -math -mdev -pam (-selinux) -sep-usr
> > -syslog -systemd" 0 KiB
> > 
> > 
> > With 'CONFIG_STACK_OPTIMIZATION_386=y' or 'CONFIG_STACK_OPTIMIZATION_386=n'.
> > I have the same results.  No segmentation fault
> 
> See comment 7. The package build doesn't bypasses some of the busybox build
> systme and uses the portage compile flags.

I understood that.  I was trying to reproduce the problem with the portage busybox and not busybox from genkernel.  I must be doing it wrong.
Comment 27 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-24 22:39:43 UTC
Could you please include 'disassemble' and 'info registers' details?
Comment 28 Stephen Bell 2020-08-25 17:14:49 UTC
(In reply to Thomas Deutschmann from comment #27)
> Could you please include 'disassemble' and 'info registers' details?

Dump of assembler code for function __run_exit_handlers:
   0x08056060 <+0>:     push   %ebp
   0x08056061 <+1>:     push   %edi
   0x08056062 <+2>:     push   %esi
   0x08056063 <+3>:     push   %ebx
   0x08056064 <+4>:     call   0x804a1c0 <__x86.get_pc_thunk.bx>
   0x08056069 <+9>:     add    $0x203f97,%ebx
   0x0805606f <+15>:    sub    $0x3c,%esp
   0x08056072 <+18>:    mov    0x58(%esp),%eax
   0x08056076 <+22>:    mov    $0x0,%edx
   0x0805607c <+28>:    mov    %eax,0x2c(%esp)
   0x08056080 <+32>:    mov    %ebx,0x28(%esp)
   0x08056084 <+36>:    mov    0x5c(%esp),%eax
   0x08056088 <+40>:    test   %edx,%edx
   0x0805608a <+42>:    je     0x8056094 <__run_exit_handlers+52>
   0x0805608c <+44>:    test   %al,%al
   0x0805608e <+46>:    jne    0x8056310 <__run_exit_handlers+688>
   0x08056094 <+52>:    mov    0x28(%esp),%eax
   0x08056098 <+56>:    xor    %esi,%esi
   0x0805609a <+58>:    mov    $0x825d620,%ebp
   0x080560a0 <+64>:    mov    %gs:0xc,%eax
   0x080560a6 <+70>:    mov    $0x1,%edx
   0x080560ab <+75>:    test   %eax,%eax
   0x080560ad <+77>:    jne    0x80562c9 <__run_exit_handlers+617>
   0x080560b3 <+83>:    cmpxchg %edx,0x0(%ebp)
   0x080560b7 <+87>:    mov    0x54(%esp),%eax
   0x080560bb <+91>:    mov    (%eax),%eax
   0x080560bd <+93>:    mov    %eax,0x24(%esp)
   0x080560c1 <+97>:    test   %eax,%eax
   0x080560c3 <+99>:    jne    0x805611e <__run_exit_handlers+190>
   0x080560c5 <+101>:   jmp    0x8056264 <__run_exit_handlers+516>
   0x080560ca <+106>:   lea    0x0(%esi),%esi
   0x080560d0 <+112>:   cmp    $0x2,%eax
   0x080560d3 <+115>:   je     0x80561c0 <__run_exit_handlers+352>
   0x080560d9 <+121>:   mov    %gs:0xc,%eax
   0x080560df <+127>:   mov    $0x1,%edx
   0x080560e4 <+132>:   test   %eax,%eax
   0x080560e6 <+134>:   jne    0x80561e0 <__run_exit_handlers+384>
   0x080560ec <+140>:   cmpxchg %edx,0x0(%ebp)
   0x080560f0 <+144>:   mov    0x28(%esp),%eax
   0x080560f4 <+148>:   mov    0x361c(%eax),%edx
   0x080560fa <+154>:   mov    0x3618(%eax),%eax
   0x08056100 <+160>:   mov    %edx,0x14(%esp)
   0x08056104 <+164>:   mov    %eax,0x10(%esp)
=> 0x08056108 <+168>:   vmovaps 0x10(%esp),%xmm1
   0x0805610e <+174>:   vxorps (%esp),%xmm1,%xmm0
   0x08056113 <+179>:   vpunpcklqdq %xmm0,%xmm0,%xmm0
   0x08056117 <+183>:   vptest %xmm0,%xmm0
   0x0805611c <+188>:   jne    0x80560b7 <__run_exit_handlers+87>
   0x0805611e <+190>:   mov    0x24(%esp),%eax
   0x08056122 <+194>:   mov    0x4(%eax),%edi
   0x08056125 <+197>:   test   %edi,%edi
   0x08056127 <+199>:   je     0x8056230 <__run_exit_handlers+464>
   0x0805612d <+205>:   mov    0x24(%esp),%ecx
   0x08056131 <+209>:   lea    -0x1(%edi),%eax
   0x08056134 <+212>:   mov    %eax,0x4(%ecx)
   0x08056137 <+215>:   mov    0x28(%esp),%eax
   0x0805613b <+219>:   mov    0x361c(%eax),%edx
   0x08056141 <+225>:   mov    0x3618(%eax),%eax
   0x08056147 <+231>:   mov    %edx,0x4(%esp)
   0x0805614b <+235>:   mov    %eax,(%esp)
   0x0805614e <+238>:   mov    %gs:0xc,%eax
   0x08056154 <+244>:   test   %eax,%eax
   0x08056156 <+246>:   jne    0x8056200 <__run_exit_handlers+416>
   0x0805615c <+252>:   decl   0x0(%ebp)
   0x0805615f <+255>:   shl    $0x4,%edi
   0x08056162 <+258>:   add    0x24(%esp),%edi
   0x08056166 <+262>:   mov    -0x8(%edi),%eax
   0x08056169 <+265>:   cmp    $0x3,%eax
   0x0805616c <+268>:   je     0x80561a0 <__run_exit_handlers+320>
   0x0805616e <+270>:   cmp    $0x4,%eax
   0x08056171 <+273>:   jne    0x80560d0 <__run_exit_handlers+112>
   0x08056177 <+279>:   sub    $0x8,%esp
   0x0805617a <+282>:   mov    -0x4(%edi),%eax
   0x0805617d <+285>:   movl   $0x0,-0x8(%edi)
   0x08056184 <+292>:   pushl  0x58(%esp)
   0x08056188 <+296>:   pushl  (%edi)
   0x0805618a <+298>:   ror    $0x9,%eax
   0x0805618d <+301>:   xor    %gs:0x18,%eax
   0x08056194 <+308>:   call   *%eax
   0x08056196 <+310>:   add    $0x10,%esp
   0x08056199 <+313>:   jmp    0x80560d9 <__run_exit_handlers+121>
   0x0805619e <+318>:   xchg   %ax,%ax
   0x080561a0 <+320>:   mov    -0x4(%edi),%eax
   0x080561a3 <+323>:   ror    $0x9,%eax
   0x080561a6 <+326>:   xor    %gs:0x18,%eax
   0x080561ad <+333>:   call   *%eax
   0x080561af <+335>:   jmp    0x80560d9 <__run_exit_handlers+121>
   0x080561b4 <+340>:   lea    0x0(%esi,%eiz,1),%esi
   0x080561bb <+347>:   lea    0x0(%esi,%eiz,1),%esi
   0x080561bf <+351>:   nop
   0x080561c0 <+352>:   sub    $0x8,%esp
   0x080561c3 <+355>:   mov    -0x4(%edi),%eax
   0x080561c6 <+358>:   pushl  (%edi)
   0x080561c8 <+360>:   pushl  0x5c(%esp)
   0x080561cc <+364>:   ror    $0x9,%eax
   0x080561cf <+367>:   xor    %gs:0x18,%eax
   0x080561d6 <+374>:   call   *%eax
   0x080561d8 <+376>:   add    $0x10,%esp
   0x080561db <+379>:   jmp    0x80560d9 <__run_exit_handlers+121>
   0x080561e0 <+384>:   mov    %esi,%eax
   0x080561e2 <+386>:   lock cmpxchg %edx,0x0(%ebp)
   0x080561e7 <+391>:   je     0x80560f0 <__run_exit_handlers+144>
   0x080561ed <+397>:   sub    $0xc,%esp
   0x080561f0 <+400>:   push   %ebp
   0x080561f1 <+401>:   call   0x806fa30 <__lll_lock_wait_private>
   0x080561f6 <+406>:   add    $0x10,%esp
   0x080561f9 <+409>:   jmp    0x80560f0 <__run_exit_handlers+144>
   0x080561fe <+414>:   xchg   %ax,%ax
   0x08056200 <+416>:   mov    %esi,%eax
   0x08056202 <+418>:   xchg   %eax,0x0(%ebp)
   0x08056205 <+421>:   cmp    $0x1,%eax
   0x08056208 <+424>:   jle    0x805615f <__run_exit_handlers+255>
   0x0805620e <+430>:   mov    $0x81,%ecx
   0x08056213 <+435>:   mov    $0x1,%edx
   0x08056218 <+440>:   mov    $0xf0,%eax
   0x0805621d <+445>:   mov    %ebp,%ebx
   0x0805621f <+447>:   call   *%gs:0x10
   0x08056226 <+454>:   jmp    0x805615f <__run_exit_handlers+255>
   0x0805622b <+459>:   lea    0x0(%esi,%eiz,1),%esi
   0x0805622f <+463>:   nop
   0x08056230 <+464>:   mov    0x54(%esp),%ecx
   0x08056234 <+468>:   mov    %eax,%ebx
   0x08056236 <+470>:   mov    (%eax),%eax
   0x08056238 <+472>:   mov    %eax,(%ecx)
   0x0805623a <+474>:   test   %eax,%eax
   0x0805623c <+476>:   je     0x805624e <__run_exit_handlers+494>
   0x0805623e <+478>:   sub    $0xc,%esp
   0x08056241 <+481>:   push   %ebx
   0x08056242 <+482>:   mov    0x38(%esp),%ebx
   0x08056246 <+486>:   call   0x8074eb0 <free>
   0x0805624b <+491>:   add    $0x10,%esp
   0x0805624e <+494>:   mov    %gs:0xc,%eax
   0x08056254 <+500>:   test   %eax,%eax
   0x08056256 <+502>:   jne    0x80562e7 <__run_exit_handlers+647>
   0x0805625c <+508>:   decl   0x0(%ebp)
   0x0805625f <+511>:   jmp    0x80560a0 <__run_exit_handlers+64>
   0x08056264 <+516>:   mov    0x28(%esp),%eax
   0x08056268 <+520>:   movb   $0x1,0x2ea5(%eax)
   0x0805626f <+527>:   mov    %gs:0xc,%eax
   0x08056275 <+533>:   test   %eax,%eax
   0x08056277 <+535>:   jne    0x805631a <__run_exit_handlers+698>
   0x0805627d <+541>:   decl   0x0(%ebp)
   0x08056280 <+544>:   cmpb   $0x0,0x2c(%esp)
   0x08056285 <+549>:   je     0x80562b9 <__run_exit_handlers+601>
   0x08056287 <+551>:   mov    0x28(%esp),%eax
   0x0805628b <+555>:   mov    $0x825b694,%esi
   0x08056291 <+561>:   mov    $0x825b698,%eax
   0x08056297 <+567>:   cmp    %eax,%esi
   0x08056299 <+569>:   jae    0x80562b9 <__run_exit_handlers+601>
   0x0805629b <+571>:   dec    %eax
   0x0805629c <+572>:   sub    %esi,%eax
   0x0805629e <+574>:   shr    $0x2,%eax
   0x080562a1 <+577>:   lea    0x4(%esi,%eax,4),%edi
   0x080562a5 <+581>:   lea    0x0(%esi,%eiz,1),%esi
   0x080562ac <+588>:   lea    0x0(%esi,%eiz,1),%esi
   0x080562b0 <+592>:   call   *(%esi)
   0x080562b2 <+594>:   add    $0x4,%esi
   0x080562b5 <+597>:   cmp    %esi,%edi
   0x080562b7 <+599>:   jne    0x80562b0 <__run_exit_handlers+592>
   0x080562b9 <+601>:   sub    $0xc,%esp
   0x080562bc <+604>:   pushl  0x5c(%esp)
   0x080562c0 <+608>:   mov    0x38(%esp),%ebx
   0x080562c4 <+612>:   call   0x81e5dca <_exit>
   0x080562c9 <+617>:   mov    %esi,%eax
   0x080562cb <+619>:   lock cmpxchg %edx,0x0(%ebp)
   0x080562d0 <+624>:   je     0x80560b7 <__run_exit_handlers+87>
   0x080562d6 <+630>:   sub    $0xc,%esp   0x080562d9 <+633>:   push   %ebp
   0x080562da <+634>:   call   0x806fa30 <__lll_lock_wait_private>
   0x080562df <+639>:   add    $0x10,%esp
   0x080562e2 <+642>:   jmp    0x80560b7 <__run_exit_handlers+87>
   0x080562e7 <+647>:   mov    %esi,%eax
   0x080562e9 <+649>:   xchg   %eax,0x0(%ebp)
   0x080562ec <+652>:   dec    %eax
   0x080562ed <+653>:   jle    0x80560a0 <__run_exit_handlers+64>
   0x080562f3 <+659>:   mov    $0xf0,%eax
   0x080562f8 <+664>:   mov    $0x81,%ecx
   0x080562fd <+669>:   mov    $0x1,%edx
   0x08056302 <+674>:   mov    %ebp,%ebx
   0x08056304 <+676>:   call   *%gs:0x10
   0x0805630b <+683>:   jmp    0x80560a0 <__run_exit_handlers+64>
   0x08056310 <+688>:   call   0x0
   0x08056315 <+693>:   jmp    0x8056094 <__run_exit_handlers+52>
   0x0805631a <+698>:   xor    %esi,%esi
   0x0805631c <+700>:   mov    %esi,%eax
   0x0805631e <+702>:   xchg   %eax,0x0(%ebp)
   0x08056321 <+705>:   dec    %eax
   0x08056322 <+706>:   jle    0x8056280 <__run_exit_handlers+544>
   0x08056328 <+712>:   mov    $0xf0,%eax
   0x0805632d <+717>:   mov    $0x81,%ecx
   0x08056332 <+722>:   mov    $0x1,%edx
   0x08056337 <+727>:   mov    %ebp,%ebx
   0x08056339 <+729>:   call   *%gs:0x10
   0x08056340 <+736>:   jmp    0x8056280 <__run_exit_handlers+544>
Comment 29 Stephen Bell 2020-08-25 17:15:46 UTC
(In reply to Stephen Bell from comment #28)
> (In reply to Thomas Deutschmann from comment #27)
> > Could you please include 'disassemble' and 'info registers' details?
(gdb) info registers
eax            0x1                 1
ecx            0x825c7c0           136693696
edx            0x0                 0
ebx            0x825a000           136683520
esp            0xbfffe98c          0xbfffe98c
ebp            0x825d620           0x825d620 <__exit_funcs_lock>
esi            0x0                 0
edi            0x825b7b0           136689584
eip            0x8056108           0x8056108 <__run_exit_handlers+168>
eflags         0x10246             [ PF ZF IF RF ]
cs             0x73                115
ss             0x7b                123
ds             0x7b                123
es             0x7b                123
fs             0x0                 0
gs             0x33                51
Comment 30 Thomas Deutschmann (RETIRED) gentoo-dev 2020-08-27 18:08:33 UTC
Thank you, backtrace/registers are confirming stack problem.

Feel free to report upstream.

CONFIG_STACK_OPTIMIZATION_386 is disabled in >=genkerel-4.1.1.