Bug 147600 - grub segfaults on x86_64
grub segfaults on x86_64
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: grub (Show other bugs)
3
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-09 12:55 EST by Phil Schaffner
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-03 13:39:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Phil Schaffner 2005-02-09 12:55:52 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3)
Gecko/20041020

Description of problem:
Installed a new disk, copied/configured/booted FC3 installation, and
attempted to reconfigure grub to use the new /boot partition. 
Attempting to run grub or grub-install to update boot record results
in "Segmentation fault".  The old MBR is not changed.  Found the
following on fedora-list
https://www.redhat.com/archives/fedora-list/2005-January/msg07424.html
but no resolution or Bugzilla entry.

Version-Release number of selected component (if applicable):
grub-0.95-3

How reproducible:
Always

Steps to Reproduce:
1. run grub or grub-install
2.
3.
    

Actual Results:  Segmentation fault

Expected Results:  Successful installation of grub loader.

Additional info:

[root@wx1 ~]# grub-install /dev/sdb1
/sbin/grub-install: line 475:  5327 Segmentation fault     
$grub_shell --batch $no_floppy --device-map=$device_map  >$log_file <<EOF
root $root_drive
setup $force_lba --stage2=$grubdir/stage2 --prefix=$grub_prefix
$install_drive
quit
EOF

Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(fd0)     /dev/fd0
(hd0)     /dev/sda
(hd1)     /dev/sdb
[root@wx1 ~]# grub
Probing devices to guess BIOS drives. This may take a long time.
end_request: I/O error, dev fd0, sector 0


    GNU GRUB  version 0.95  (640K lower / 3072K 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 (hd1,0)
root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83
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/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
Segmentation fault
[root@wx1 ~]# lspci
00:06.0 PCI bridge: Advanced Micro Devices [AMD] AMD-8111 PCI (rev 07)
00:07.0 ISA bridge: Advanced Micro Devices [AMD] AMD-8111 LPC (rev 05)
00:07.1 IDE interface: Advanced Micro Devices [AMD] AMD-8111 IDE (rev 03)
00:07.2 SMBus: Advanced Micro Devices [AMD] AMD-8111 SMBus 2.0 (rev 02)
00:07.3 Bridge: Advanced Micro Devices [AMD] AMD-8111 ACPI (rev 05)
00:07.5 Multimedia audio controller: Advanced Micro Devices [AMD]
AMD-8111 AC97 Audio (rev 03)
00:0a.0 PCI bridge: Advanced Micro Devices [AMD] AMD-8131 PCI-X Bridge
(rev 12)
00:0a.1 PIC: Advanced Micro Devices [AMD] AMD-8131 PCI-X APIC (rev 01)
00:0b.0 PCI bridge: Advanced Micro Devices [AMD] AMD-8131 PCI-X Bridge
(rev 12)
00:0b.1 PIC: Advanced Micro Devices [AMD] AMD-8131 PCI-X APIC (rev 01)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8
[Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8
[Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8
[Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8
[Athlon64/Opteron] Miscellaneous Control
00:19.0 Host bridge: Advanced Micro Devices [AMD] K8
[Athlon64/Opteron] HyperTransport Technology Configuration
00:19.1 Host bridge: Advanced Micro Devices [AMD] K8
[Athlon64/Opteron] Address Map
00:19.2 Host bridge: Advanced Micro Devices [AMD] K8
[Athlon64/Opteron] DRAM Controller
00:19.3 Host bridge: Advanced Micro Devices [AMD] K8
[Athlon64/Opteron] Miscellaneous Control
02:09.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5703X
Gigabit Ethernet (rev 02)
03:00.0 USB Controller: Advanced Micro Devices [AMD] AMD-8111 USB (rev 0b)
03:00.1 USB Controller: Advanced Micro Devices [AMD] AMD-8111 USB (rev 0b)
03:0b.0 RAID bus controller: Silicon Image, Inc. (formerly CMD
Technology Inc) SiI 3114 [SATALink/SATARaid] Serial ATA Controller
(rev 02)
03:0c.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22/A
IEEE-1394a-2000 Controller (PHY/Link)
04:00.0 Host bridge: Advanced Micro Devices [AMD] AMD-8151 System
Controller (rev 14)
04:01.0 PCI bridge: Advanced Micro Devices [AMD] AMD-8151 AGP Bridge
(rev 14)
05:00.0 VGA compatible controller: nVidia Corporation NV36.2 [GeForce
FX 5700] (rev a1)
[root@wx1 ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb2             63938788   6593912  54096936  11% /
/dev/sdb1               101086     33899     61968  36% /boot
/dev/md0             240362560 105976260 122176508  47% /home
/dev/sda2            156199592 117756132  30508960  80% /alt
/dev/sda1               101086     18269     77598  20% /alt/boot
none                   2048636         0   2048636   0% /dev/shm
Comment 1 Quereller 2005-02-18 17:28:27 EST
I can confirm this but only for smp-kernel, with up-kernel it works.
Comment 2 Phil Schaffner 2005-02-23 15:05:37 EST
Not for me.  Get segmantation faults with both kernel-2.6.10-1.766_FC3
and kernel-smp-2.6.10-1.766_FC3
Comment 3 Stelian Pop 2005-02-28 16:37:33 EST
I confirm I get this too with 2.6.10-1.766_FC3 UP.
Comment 4 Stelian Pop 2005-03-01 06:15:10 EST
After investigations, I found that this bug has been reported upstream
and is caused by grub using dynamically allocated pages to put
executable code which causes problems because of x86_64 NX feature.

A patch which converts malloc to mmap for this memory is provided in
the upstream bug report at:
http://savannah.gnu.org/bugs/?func=detailitem&item_id=11312

I tested this patch and can confirm that it does fix grub's segfaults
for me.

Stelian.
Comment 5 Phil Schaffner 2005-03-03 13:39:20 EST
Tried grub-0.95-11.x86_64 from rawide.  First tried to apply tie patch
to SRPM and rebuild.  Does not have exactly the patch above but does
have an overlapping one that seems to do the trick.  The rawhide
binary RPM works.  Changing to RESOLVED/RAWHIDE.

Note You need to log in before you can comment on or make changes to this bug.