Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 566638 - sys-boot/grub-0.97-r14 - emerge continues despite Segmentation fault
Summary: sys-boot/grub-0.97-r14 - emerge continues despite Segmentation fault
Status: RESOLVED DUPLICATE of bug 564890
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-23 16:08 UTC by Martin Mokrejš
Modified: 2015-12-08 21:31 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 Martin Mokrejš 2015-11-23 16:08:55 UTC
...
make[2]: Leaving directory `/var/tmp/portage/sys-boot/grub-0.97-r14/work/grub-0.97'
make[1]: Leaving directory `/var/tmp/portage/sys-boot/grub-0.97-r14/work/grub-0.97'
 *      /var/tmp/portage/sys-boot/grub-0.97-r14/image//sbin/grub
 TYPE    PAX   FILE 
ET_EXEC --mxe- /var/tmp/portage/sys-boot/grub-0.97-r14/image//sbin/grub 
 *      /var/tmp/portage/sys-boot/grub-0.97-r14/image//sbin/grub
 * XT PaX marking -me /var/tmp/portage/sys-boot/grub-0.97-r14/image//sbin/grub with setfattr
setfattr: /var/tmp/portage/sys-boot/grub-0.97-r14/image//sbin/grub: Operation not supported
 * Failed to set XATTR_PAX markings -me /var/tmp/portage/sys-boot/grub-0.97-r14/image//sbin/grub.
>>> Completed installing grub-0.97-r14 into /var/tmp/portage/sys-boot/grub-0.97-r14/image/

ecompressdir: bzip2 -9 /usr/share/info
ecompressdir: bzip2 -9 /usr/share/man
ecompressdir: bzip2 -9 /usr/share/doc

>>> Installing (1 of 1) sys-boot/grub-0.97-r14

 * Your boot partition was detected as being mounted at /boot.
 * Files will be installed there for grub to function correctly.

 * Your boot partition was detected as being mounted at /boot.
 * Files will be installed there for grub to function correctly.

 * Your boot partition was detected as being mounted at /boot.
 * Files will be installed there for grub to function correctly.
 * *** IMPORTANT NOTE: you must run grub and install
 * the new version's stage1 to your MBR.  Until you do,
 * stage1 and stage2 will still be the old version, but
 * later stages will be the new version, which could
 * cause problems such as an unbootable system.
 * 
 * This means you must use either grub-install or perform
 * root/setup manually.
 * 
 * For more help, see the handbook:
 * https://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=10#grub-install-auto

 * Copying files from /lib/grub and /usr/share/grub to //boot/grub
/var/tmp/portage/sys-boot/grub-0.97-r14/temp/environment: line 4067: 31016 Done                    egrep -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' "${grub_config}"
     31017 Segmentation fault      (core dumped) | /sbin/grub --batch --device-map="${dir}"/device.map > /dev/null
 * Grub has been installed to //boot successfully.
 * 
 * To interactively install grub files to another device such as a USB
 * stick, just run the following and specify the directory as prompted:
 *    emerge --config =grub-0.97-r14
 * Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell
 * grub where to install in a non-interactive way.

...

I think the ebuild should check that the /sbin/grub binary works. It dumps core on me but gdb cannot find any symbols in it. I tried USE="static -ncurses" but that did not help. Starting /sbin/grub gives me the grub shell, but during quit I get a core dump. I tried gcc-4.6.3 and 4.7.4 with no change. Maybe the -Os compiler flag is too aggressive or buggy? Either way, my C{XX}FLAGS are ignored so I can't do much at the moment.


# emerge --info
WARNING: One or more repositories have missing repo_name entries:

        /var/lib/layman/profiles/repo_name

NOTE: Each repo_name entry should be a plain text file containing a
unique name for the repository on the first line.

# emerge --info
Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.9.3, glibc-2.21-r1, 3.2.57 x86_64)
=================================================================
System uname: Linux-3.2.57-x86_64-Intel-R with-gentoo-2.2
KiB Mem:   xx total,    xx free
KiB Swap:  xx total,    xx free
Timestamp of tree: Sun, 22 Nov 2015 12:00:01 +0000
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.2
dev-lang/python:          2.7.5-r3, 3.2.5-r3, 3.3.3, 3.4.3
dev-util/cmake:           2.8.12.2
dev-util/pkgconfig:       0.28-r2
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.9.6-r3, 1.11.1-r1, 1.13.4, 1.14.1, 1.15
sys-devel/binutils:       2.25.1-r1
sys-devel/gcc:            4.1.2, 4.2.4-r1, 4.3.6-r1, 4.4.7, 4.7.4, 4.8.5, 4.9.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.6
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.21-r1
Repositories: gentoo science x-portage x-layman
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm PUEL Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fno-strict-aliasing -march=native -mno-avx -mpclmul -mpopcnt"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -fno-strict-aliasing -march=native -mno-avx -mpclmul -mpopcnt"
DISTDIR="/scratch/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nostrip 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"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
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="/scratch/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/science /var/lib/layman"
USE="X amd64 apache2 apng berkdb bzip2 cgi cli cracklib crypt cxx dbus dlz expat fontconfig fortran gd gdbm gnutls hal iconv innodb introspection java jce jpeg jpg lapack laptop mmx mmxext modules mpi mpich2 multilib mysql ncurses nfs nls nptl nptlonly nsplugin opengl openmp openssl pam pcre perl png python qt3support qt4 readline seccomp server session sse sse2 sse4_1 sse4_2 ssl ssse3 static-libs suexec svg syslog tcl tcpd threads tiff truetype udev unicode usb xattr xml 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="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dbd deflate dir disk_cache env expires ext_filter file_cache filter headers icu ident imagemap include info log_config mem_cache mime mime_magic rewrite setenvif speling status unique_id userdir usertrack vhost_alias negotiation" 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="aes mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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="en cs cz" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="vesa matrox" 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, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 1 Martin Mokrejš 2015-11-23 16:37:20 UTC
So, the issue with gcc caused by -O2 in ${WORKDIR}/grub-0.97/config.status:

S["GRUB_CFLAGS"]="-O2 -fno-strict-aliasing"

Grub crashes with any of [-O1,-O2,-Os]. This happens with x86_64-pc-linux-gnu-4.9.3 but not with x86_64-pc-linux-gnu-4.7.4 nor x86_64-pc-linux-gnu-4.8.5.
Comment 2 Ian Stakenvicius (RETIRED) gentoo-dev 2015-12-08 21:31:46 UTC
So, if commands fail during pkg_postinst it can actually be worse to die rather than to continue, as there's no rolling back at that point.

The actual issue as to why it dies is bug 564890 , so I'm going to mark this one as a duplicate.

*** This bug has been marked as a duplicate of bug 564890 ***