Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 508758 - sys-boot/grub-2.02_beta2 with sys-devel/gcc-4.8.2-r1 miscompiles grub-mkimage? - sh: line 1: 32183 Segmentation fault in grub-mkimage --help
Summary: sys-boot/grub-2.02_beta2 with sys-devel/gcc-4.8.2-r1 miscompiles grub-mkimage...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 915000 gcc-4.8
  Show dependency tree
 
Reported: 2014-04-26 11:35 UTC by Roc Vallès
Modified: 2023-10-01 06:04 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,775.58 KB, text/plain)
2014-04-26 18:42 UTC, Roc Vallès
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roc Vallès 2014-04-26 11:35:53 UTC
Works with gcc-4.7.3, fails with gcc-4.8.2.

[ebuild     U  ] sys-boot/grub-2.02_beta2:2 [2.00_p5107-r2:2] USE="multislot nls sdl truetype -debug -device-mapper -doc -efiemu -libzfs -mount -static {-test} (-custom-cflags%)" GRUB_PLATFORMS="-coreboot -efi-32 -efi-64 -emu -ieee1275 -multiboot -pc -qemu -qemu-mips -xen% -yeeloong" 0 kB

(...)
PATH=.:$PATH pkgdatadir=. /usr/bin/help2man --section=1 -i /var/tmp/portage/sys-boot/grub-2.02_beta2/work/grub-2.02~beta2/docs/man/grub-mkrelpath.h2m -o grub-mkrelpath.1 grub-mkrelpath
chmod a+x grub-script-check
PATH=.:$PATH pkgdatadir=. /usr/bin/help2man --section=1 -i /var/tmp/portage/sys-boot/grub-2.02_beta2/work/grub-2.02~beta2/docs/man/grub-script-check.h2m -o grub-script-check.1 grub-script-check
sh: line 1: 10443 Segmentation fault      grub-mkimage --help 2> /dev/null
help2man: can't get `--help' info from grub-mkimage
Try `--no-discard-stderr' if option outputs to stderr
Makefile:12771: recipe for target 'grub-mkimage.1' failed
make[2]: *** [grub-mkimage.1] Error 139
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/var/tmp/portage/sys-boot/grub-2.02_beta2/work/grub-2.02~beta2-guessed'

reimu ~ # emerge --info
Portage 2.2.10 (default/linux/amd64/13.0, gcc-4.8.2, glibc-2.19, 3.15.0-rc2 x86_64)
=================================================================
System uname: Linux-3.15.0-rc2-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9550_@_2.83GHz-with-gentoo-2.2
KiB Mem:     8168580 total,    796748 free
KiB Swap:    8388604 total,   8321644 free
Timestamp of tree: Sat, 26 Apr 2014 10:30:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p47
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6-r1, 3.3.5, 3.4.0
dev-util/cmake:           2.8.12.2
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.14.1
sys-devel/binutils:       2.24-r2
sys-devel/gcc:            4.7.3-r1, 4.8.2-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.14 (virtual/os-headers)
sys-libs/glibc:           2.19
Repositories: gentoo AniDBUdpClient-overlay gamerlay gentoojp roslin x-portage
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=core2 -msse4.1 -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /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="-O3 -pipe -march=core2 -msse4.1 -fomit-frame-pointer -fpermissive"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/AniDBUdpClient-overlay /var/lib/layman/gamerlay /var/lib/layman/gentoojp /var/lib/layman/roslin /usr/local/portage"
USE="7zip S3TC X a52 aac aalib acl acpi alac alsa amd64 anthy apng avahi berkdb bluetooth bmp btrfs bzip2 cairo cdda cddb cjk cli cracklib crypt cscope css cups curl cxx dbus dirac djvu dmraid dri drm dssi dts dvb dvd dvdr dvdread egl emacs enca encode exif expat fat fbcon ffmpeg firefox flac fltk fluidsynth fortran ftdi fuse gd gdbm gif gimp gles1 gles2 glib gmp gnome gpg gsm gstreamer gtk gtk3 hbci hvm iconv icu idn immqt-bc inotify ipv6 jack jadetex java javascript joystick jpeg kate kde kqemu ladspa latex lm_sensors logitech-mouse lzo mac mad matroska mdadm mdnsresponder-compat midi mikmod mmap mmx mng mod modplug modules mp3 mpeg multilib musepack ncurses net network-cron nls nodrm nptl nsplugin ntfs offensive ofx ogg openal opengl openmp openssl openvg opus oss pam parallel paste64 pcntl pcre pdf perl pkcs11 png ppds private-headers python qt3 qt3support qt4 quotes rar readline rtc rubberband ruby samba schroedinger sdl semantic-desktop session shaders shorten sid sip sipim slang smp sndfile sox speex spell sqlite sqlite3 srt sse sse2 sse3 sse4 ssl ssse3 startup-notification svg sysfs systemd tcl tcpd theora threads tiff timidity tk truetype udisks unicode usb v4l v4l2 vcd vdpau vim-syntax vnc vorbis wav wavpack webm webp wxwidgets wxwindows x264 xcb xcomposite xfce xforms xfs xinerama xml xmp xulrunner xv xvmc zeroconf zip zlib" ABI_X86="64 32" ALSA_CARDS="emu10k1" 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" DVB_CARDS="tda10045 tda10046 usb-dib0700 ttusb-dec" 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" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3 python3_3" QEMU_SOFTMMU_TARGETS="*" QEMU_USER_TARGETS="*" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="radeon r600" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-04-26 16:04:11 UTC
Please attach the entire build log to this bug report.
Comment 2 Roc Vallès 2014-04-26 16:34:09 UTC
For whatever silly reason... trying to upload the attachment doesn't work right now.

Trying to post from firefox does fail silently (submit button does nothing), whereas chromium puts https://bugs.gentoo.org/attachment.cgi on urlbar and goes: 

The webpage at https://bugs.gentoo.org/attachment.cgi might be temporarily down or it may have moved permanently to a new web address.
Error code: ERR_ACCESS_DENIED
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-04-26 18:25:56 UTC
(In reply to Roc Vallès from comment #2)

Please try again.
Comment 4 Roc Vallès 2014-04-26 18:29:36 UTC
(In reply to Jeroen Roovers from comment #3)
> (In reply to Roc Vallès from comment #2)
> 
> Please try again.

No improvement.
Comment 5 Roc Vallès 2014-04-26 18:42:33 UTC
Created attachment 375796 [details]
build.log
Comment 6 Roc Vallès 2014-04-26 18:44:39 UTC
Explanation: Both firefox and chromium are awesome usability-wise.

The real problem was that build.log wasn't a readable file from the browser's pov.
Comment 7 Mike Gilbert gentoo-dev 2014-04-26 19:53:16 UTC
Can you run grub-mkimage in a debugger and get a backtrace?
Comment 8 Mike Gilbert gentoo-dev 2014-04-26 20:03:51 UTC
This seems to be related to some compiler optimization. I can reproduce the segfault with CFLAGS="-O3".

As a workaround, drop down to -O2.
Comment 9 Roc Vallès 2014-04-26 20:22:35 UTC
(In reply to Mike Gilbert from comment #8)
> This seems to be related to some compiler optimization. I can reproduce the
> segfault with CFLAGS="-O3".
> 
> As a workaround, drop down to -O2.

Took care of that via portage.env... Grub used to have a "custom-cflags" use flag, but it's rained since then. I should have noticed it was using -O3, PEBKAC.
Comment 10 Mike Gilbert gentoo-dev 2014-04-26 21:01:39 UTC
I would rather not argue with upstream about ricer flags, so I just used replace-flags in the ebuild.

+  26 Apr 2014; Mike Gilbert <floppym@gentoo.org> grub-2.02_beta2.ebuild,
+  grub-9999-r1.ebuild:
+  Replace -O3 with -O2 to prevent segfault in grub-mkimage, bug 508758 by Roc
+  Vallès.
Comment 11 Roc Vallès 2014-04-26 21:04:00 UTC
(In reply to Mike Gilbert from comment #10)
> I would rather not argue with upstream about ricer flags, so I just used
> replace-flags in the ebuild.
> 
> +  26 Apr 2014; Mike Gilbert <floppym@gentoo.org> grub-2.02_beta2.ebuild,
> +  grub-9999-r1.ebuild:
> +  Replace -O3 with -O2 to prevent segfault in grub-mkimage, bug 508758 by
> Roc
> +  Vallès.

That's definitely for the best with this specific ebuild.