Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 602770 - sys-devel/binutils-2.27: Built kernel with (U)EFI stub crashes during early init phase
Summary: sys-devel/binutils-2.27: Built kernel with (U)EFI stub crashes during early i...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-15 16:28 UTC by Sven E.
Modified: 2017-03-13 22:46 UTC (History)
0 users

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 Sven E. 2016-12-15 16:28:00 UTC
On a Gentoo guest in Virtualbox I rebuilt a kernel, which after rebuilding, makes Virtualbox crash. Sem kernel config built with binutil <2.27 works fine.

Reproducible: Always

Steps to Reproduce:
1. Build kernel with efi stub
2. boot kernel via efi stub

Actual Results:  
Crashing kernel

Expected Results:  
Booting kernel

After some time I had to recreate the kernel to include initramfs changes. Surprisingly the kernel did not boot but Virtualbox crashed. First I changed Virtualbox versions, without any effect. I tried a different kernel version with same config, still crashing. I then took the time to switch back to binutils-2.26, make clean && make both kernel versions again. And they are working as expected. I then tried the crashing kernel on a native platform and it indeed leads to a reset of the platform.

Kernel Versions are: 3.16.37/39 and 3.18.45.
Comment 1 Sven E. 2016-12-15 18:30:00 UTC
I just tested this with 4.1.36.

binutils-2.26, kernel works in Virtualbox and on native platform.
binutils-2.27, kernel crashes in Virtualbox and on native platform.

I guess, I could possibly check more native platforms.

Sicne the behavior is consistent over at least 3 kernel versions, I think this is really related to binutils-2.27.
Comment 2 Michael Palimaka (kensington) gentoo-dev 2016-12-22 14:48:27 UTC
Please add emerge --info.
Comment 3 Sven E. 2016-12-22 18:31:11 UTC
emerge --info:

Portage 2.3.3 (python 2.7.12-final-0, default/linux/amd64/13.0/desktop, gcc-5.3.0, glibc-2.23-r3, 4.4.8-hardened x86_64)
=================================================================
System uname: Linux-4.4.8-hardened-x86_64-AMD_A10-5700_APU_with_Radeon-tm-_HD_Graphics-with-gentoo-2.3
KiB Mem:     6104816 total,   5636496 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 15 Dec 2016 16:30:01 +0000
sh bash 4.4_p5-r1
ld GNU ld (Gentoo 2.27 p1.0) 2.27
app-shells/bash:          4.4_p5-r1::gentoo
dev-lang/perl:            5.24.0-r2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo
dev-util/cmake:           3.7.1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.22.4::local
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo, 2.27::gentoo
sys-devel/gcc:            4.9.3::gentoo, 5.3.0::gentoo, 5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.8::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r3::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-m64 -march=x86-64 -mtune=generic -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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="-m64 -march=x86-64 -mtune=generic -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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 amd64 berkdb bluetooth branding bzip2 cairo cjk cli cracklib crypt cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gnome-keyring gpm gtk gtk3 iconv idn ipv6 jpeg lcms libkms libnotify mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support readline sdl seccomp session spell sqlite sse sse2 ssl startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" LLVM_TARGETS="AMDGPU BPF" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="virtualbox" 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_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

And for the sake of completeness:
[ebuild   R    ] sys-devel/binutils-2.27:2.27::gentoo  USE="cxx nls -multitarget -static-libs {-test} -vanilla"

Are any further build flags needed (i.e. gcc)?
Comment 4 SpanKY gentoo-dev 2017-03-12 22:00:27 UTC
can you describe how to reproduce this ?  does it only crash w/vbox ?

binutils-2.28 is in the tree now ...
Comment 5 Sven E. 2017-03-12 22:26:36 UTC
(In reply to SpanKY from comment #4)
> can you describe how to reproduce this ?  does it only crash w/vbox ?
> 
> binutils-2.28 is in the tree now ...

I switched back to 2.26.x for the time being. I did try using the very same kernel on native hardware. I used the stub by exec'ing the kernel from the UEFI shell (both vbox/native) and on native hardware an immediate reset occured.

As I noted, I tried different kernels to see if it was the stub loader's code, but the behavior was reproduceable over various kernels.

I'll see if I can check 2.28 later tonight and report back.
Comment 6 Sven E. 2017-03-13 12:51:11 UTC
I'll be damned.

I built kernel images with binutils 2.26/2.27/2.28.

All 3 images work under Vbox now. However, while staying with older binutils I kept upgrading the rest of the system constantly.

Is it possible, that this was caused by a specific combination of different packages and their respective versions?
Comment 7 SpanKY gentoo-dev 2017-03-13 22:46:05 UTC
(In reply to Sven E. from comment #6)

it very much could be a comedy of errors.  if things are working together now, i'd just call it fixed and move on to other bugs :).