Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 79378 - grub 0.95 segfaults when installing to the boot sector
Summary: grub 0.95 segfaults when installing to the boot sector
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-24 13:21 UTC by jochen
Modified: 2006-01-11 11:22 UTC (History)
2 users (show)

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 jochen 2005-01-24 13:21:43 UTC
when installing grub 0.95 to the bootsector (root (hd0,0)\n setup (hd0)\n), it segfaults

the generated core dump appears to be corrupted (endless backtrace of seemingly random addresses which results in "corrupted stackframe")

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




Portage 2.0.51-r14 (default-linux/x86/2004.3, gcc-3.4.3,
glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r6 i686)
=================================================================
System uname: 2.6.10-gentoo-r6 i686 Intel(R) Pentium(R) M processor 2.00GHz
Gentoo Base System version 1.6.8
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Jan 20 2005, 22:57:38)]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.5, 1.8.5-r2, 1.6.3, 1.7.9, 1.4_p6, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.10-r2
virtual/os-headers:  2.4.22
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium-m -O3 -pipe -mmmx -msse -msse2 -mfpmath=sse -fforce-addr
-fomit-frame-pointer -funroll-loops -frerun-cse-after-loop -frerun-loop-opt
-falign-functions=4"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium-m -O3 -pipe -mmmx -msse -msse2 -mfpmath=sse
-fforce-addr -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop
-frerun-loop-opt -falign-functions=4"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://sunsite.cnlab-switch.ch/ftp/mirror/gentoo
ftp://sunsite.cnlab-switch.ch/mirror/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d acl acpi alsa avi berkdb bitmap-fonts cdr clamav crypt dga
divx4linux doc dri dvd dvdr encode esd f77 fam font-server foomaticdb fortran
gdbm gif gimpprint glx gphoto2 gpm gpr400 gtk gtk2 gtkhtml imagemagick imap
imlib insecure-drivers ipv6 java jikes jpeg kerberos libg++ libwww live
lufsusermount mad mbox mldonkeypango mmx motif mozilla mozsvg mpeg ncurses
network nls oggvorbis opengl oss pam pcmcia pcsc-lite pdflib perl png python
quicktime readline real rtc scanner sdl spell sse sse2 ssl svga tcltk tcpd tetex
tiff truetype truetype-fonts type1-fonts unicode usb wmf x86 xanim xface xfs
xml2 xmms xv xvid zlib"
Unset:  LDFLAGS
Comment 1 Tiago Freire 2005-02-02 09:59:01 UTC
segfaulted to me as well on athlon64, while trying to install to a RAID1 reiserfs partition.
grub was compiled with the gcc vanilla, not the hardened one.

hardened-dev-sources-2.6.10-r3
glibc-2.3.4.20041102
gcc 3.4.3-r1
python-2.3.4
autoconf-2.59-r6
automake-1.9.4
binutils-2.15.92.0.2-r1
libtool-1.5.10-r4
linux26-headers-2.6.8.1-r2

screen message:
grub> root (hd1,0)
root (hd1,0)
 Filesystem type is reiserfs, partition type 0xfd
grub> setup (hd0)
setup (hd0)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/reiserfs_stage1_5" exists... yes
 Running "embed /grub/reiserfs_stage1_5 (hd0)"...  26 sectors are embedded.
succeeded
Killed


kernel log:
[kernel] grub[1046]: segfault at 0000000060f1dac0 rip 0000000060f1dac0 rsp 0000000060f1d9ec error 15

make.conf:
-----------------------------------
# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
CFLAGS="-O2 -march=k8 -ftracer -fprefetch-loop-arrays -pipe"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1 -Wl,--sort-common"
USE="3dnow X aac aalib acl acpi alsa apache2 arts avi berkdb bidi bzlib calendar canna caps cdr cjk crypt cups curl dga divx4linux doc dvd dvdr encode esd ethereal evo fam fbconfirebird flac flash foomaticdb ftp gd gif gnutls gpm hardened hardenedphp iconv imagemagick imap imlib innodb interbase iodbc ipv6 -jack java kde kdexdeltas lcms ldap libwww madmaildir mailwrapper mbox mcal mhash mime mmap mmx mng mozilla mpeg multilib mysqli nas ncurses nls nptl odbc ogg oggvorbis offensive openal opengl oss pam pcntl pcre perl php pic plotutils png posix postgres ppds prelude profile python qt quicktime readline samba sasl scanner sdl session shared sharedmem slang slp sndfile snmp soap sockets sox speex spell spl sqlite sse ssl svg svga symlink tcpd theora threads tidy tiff tokenizer truetype unicode usb vhosts wddx wmf xine xml2 xmlrpc xmms xpm xprint xsl xv xvid yahoo zlib"
MAKEOPTS="-j2"
#SYNC="rsync://portage.cert-id.com.br/portage"
---------------------------------
Comment 2 SpanKY gentoo-dev 2005-03-10 20:44:00 UTC
re-open if 0.96 bombs too
Comment 3 Travis Morgan 2005-08-31 23:44:04 UTC
Looks like this is still kicking around with 0.97. I just switched this thing to
grub from lilo after updating the entire system and world.

Hostname: justiss - OS: Linux 2.6.9-gentoo-r1/i686 - CPU: Celeron (Coppermine)
(735.266 MHz) - Processes: 32 - Uptime: 1h 29m - Load Average: 0.06 - Memory
Usage: 24.79MB/375.71MB (6.60%) - Disk Usage: 24.54GB/36.39GB (67.44%)

Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/hda3     ext3     37G   25G  9.8G  72% /
none         tmpfs    188M     0  188M   0% /dev/shm
/dev/hda1     ext2     99M  8.8M   85M  10% /boot

Portage 2.0.51.22-r2 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r1,
2.6.9-gentoo-r1 i686)
=================================================================
System uname: 2.6.9-gentoo-r1 i686 Celeron (Coppermine)
Gentoo Base System version 1.12.0_pre6
dev-lang/python:     2.2.3-r5, 2.3.4, 2.4.1-r1
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.4.19-r1, 2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i586-pc-linux-gnu"
CFLAGS="-O3 -march=pentium2 -funroll-loops -pipe"
CHOST="i586-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.1/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown
/usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O3 -march=pentium2 -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://mirrors.tera-byte.com/pub/gentoo/ ftp://gentoo.agsn.ca/
ftp://sunsite.ualberta.ca/pub/Linux/gentoo/ http://gentoo.chem.wisc.edu/gentoo/"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://gentoo.bigfiber.net/gentoo-portage"
USE="3dnow X aac aalib alsa apache2 apm atm audiofile avi berkdb bidi
bitmap-fonts bonobo cdparanoia cdr cpudetection crypt cups curl custom-cflags
dba dedicated dga dhcp divx4linux dts dv dvb dvd dvdr dvdread edl eds emboss
encode esd ethereal evo fam fbcon flac flash fltk fluidsynth foomaticdb fortran
freetds gb gd gdbm ggi gif gnome gphoto2 gpm gps gstreamer gtk gtk2 gtkhtml
guile imagemagick imap imlib ipv6 jack java javascript joystick jpeg kde lcms
libcaca libg++ libwww live lzo mad maildir matroska mikmod mmx motif mozilla
moznocompose moznoirc moznomail mozsvg mp3 mpeg mppe-mppc mysql nas ncurses net
network nowin nptl nptlonly nvidia oav odbc offensive ogg oggvorbis opengl oss
pam pda pdflib perl php png portaudio ppds python qt quicktime readline real rtc
ruby samba scanner sdl sftplogging skey slang sndfile snmp speex spell sse ssl
svg svga tcltk tcpd tetex tga theora tiff truetype truetype-fonts type1-fonts
usb v4l v4l2 vim-with-x vorbis win32codecs x86 xanim xfs xine xinerama xml xml2
xmms xosd xprint xv xvid xvmc zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY

-----------------

    GNU GRUB  version 0.97  (134830504K lower / 942945073K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x200

grub> setup (hd0)Segmentation fault


Note that grub-static works fine.
Comment 4 Travis Morgan 2005-09-01 00:09:24 UTC
Just a small addition to the above.. it still seg faults after updating the
kernel to 2.6.12-gentoo-r9.
Comment 5 SAngeli 2005-09-07 10:42:51 UTC
Hi,

as of today Sep 7th, 2005 with Gentoo 2005.1 fresh install on Intel Celeroln
after emerging grub latest stable rel and latest testing release, I was always
getting the Segmentation fault error. Please note that as soon as i run grub,
the error appeared. Not even been able to get to the first configuration line.
I solved my issue by emerging grub-static (as per gentoo manual)

Please take note of this because gentoo manuals reports:
This is a known bug related to this problem and has been fixed in grub 0.96. It
is also known that grub 0.94 r1 and grub 0.94 r2 should work correctly. If that
fails too, you can try to emerge grub-static which is currently stable on amd64
and unstable on x86 (~x86). 
Not true (rel. >=0.94)

Please let me know when this will be fixed. Also, let me know if you need extra
info.

Thank you,
Spiro
Comment 6 Geert Vanhaute 2005-09-24 03:12:58 UTC
I still get the same segfault while installing version 0.96-r1, 0.96-r2, 0.96-r3
or 0.97. Also numbers are not shown correctly (see also in remark #3 :
134830504K lower / 942945073K upper memory)

I'm working on a Intel Pentium4 not on AMD
Grub-static (0.93-something) installs without segfault and also version 0.94-r1

This means that the suggested solution 17 on
http://www.gentoo.org/doc/en/grub-error-guide.xml?style=printable is not
correct, as stated in remark #5 here above.

Because this bug is clearly not solved, could you please reopen it ?
Comment 7 michael@smith-li.com 2006-01-11 11:22:44 UTC
Grub breaks in x86 with CFLAGS="-O3", but that has been worked-around. Try adding sys-boot/grub -custom-cflags to package.use.

Maybe this should be with bug 20600, "compile flag metabug"