grub-setup crashed with SIGSEGV in __libc_start_main()

Bug #386802 reported by lann
146
This bug affects 24 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Invalid
Medium
Rolf Leggewie

Bug Description

Binary package hint: grub2

the command in terminal :

sudo grub-setup "(hd0,1)"

and segmentation fault

ProblemType: Crash
Architecture: i386
Date: Sat Jun 13 20:40:12 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/sbin/grub-setup
LiveMediaBuild: Ubuntu 9.10 "Karmic Koala" - Alpha i386 (20090610.1)
Package: grub-pc 1.96+20090523-1ubuntu1
ProcCmdline: grub-setup (hd0,1
ProcEnviron:
 PATH=(custom, no user)
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.30-8.9-generic
SegvAnalysis:
 Segfault happened at: 0x804c4b5 <exit@plt+12921>: repz cmpsb %es:(%edi),%ds:(%esi)
 PC (0x0804c4b5) ok
 source "%es:(%edi)" (0x08067132) ok
 destination "%ds:(%esi)" (0x0000007b) not located in a known VMA region (needed writable region)!
SegvReason: writing NULL VMA
Signal: 11
SourcePackage: grub2
Stacktrace:
 #0 0x0804c4b5 in ?? ()
 #1 0x0804c514 in ?? ()
 #2 0x0804a5fb in ?? ()
 #3 0x008cd7a5 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
 #4 0x08049271 in ?? ()
StacktraceTop:
 ?? ()
 ?? ()
 ?? ()
 __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
 ?? ()
Title: grub-setup crashed with SIGSEGV in __libc_start_main()
Uname: Linux 2.6.30-8-generic i686
UserGroups:

Revision history for this message
lann (lann) wrote :
Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt (retraced)

StacktraceTop:grub_util_get_dev_abstraction (os_dev=0x0)
grub_util_get_grub_dev (os_dev=0x0)
main (argc=2, argv=0xbf9599a4)

Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt (retraced)
Changed in grub2 (Ubuntu):
importance: Undecided → Medium
tags: removed: need-i386-retrace
Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

removed privacy

visibility: private → public
Revision history for this message
Kamilion (kamilion) wrote :

See #423347 for similar segfaulting.

Supermicro X8-series motherboard, 2xE5520, 16GB ram, 2X WD Black with mpt2sas JBOD LVM.

Revision history for this message
Kamilion (kamilion) wrote :

Discovered my problem while searching launchpad for similar bugs.

Found some information here:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/190147

Somehow the devicemap was incorrectly generated.

running 'sudo grub-mkdevicemap' and then 'sudo update-grub' fixed my problems.

Here's a properly generated entry now:
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-10-server" {
        set quiet=1
        insmod lvm
        insmod ext2
        set root=(BigBlock-KarmicRoot)
        search --no-floppy --fs-uuid --set 8679421a-df8d-4e61-a88d-e0cae0d9a202
        linux /boot/vmlinuz-2.6.31-10-server root=/dev/mapper/BigBlock-Karmic$
        initrd /boot/initrd.img-2.6.31-10-server
}

Revision history for this message
Jostein Martinsen (jostmart) wrote :

The post from Kamilion solved my problem also.

Revision history for this message
Brent Dunnaway (bdunnaway) wrote :

That definitely isn't solving mine.

The only thing that has worked for me is to boot into an older OS (or chroot into it) where I had an older version of grub2 (grub-pc) installed.
That version recognizes my mdadm raid devices and lvm2 devices just fine, and will actually work.

The only way I can get the alternate CD to install on my computer is to have the debconf installer use LILO instead of grub or grub2.

I'm not sure if it's something to do with the newer kernels, or the newer grub-common / grub-pc / grub2 builds, but I have tried several versions and the only one that doesn't segfault when grub-probe runs (with -t abstraction flag set) is the one that is in the official jaunty repo's.

Guess I'm stuck with LILO till we figure this out. I just hope the grub2 team is aware that there's still an issue with grub2 and lvm2/raid.

Revision history for this message
Brent Dunnaway (bdunnaway) wrote :

I hope I'm not out of line posting this here... but here's some more information on this:

Hopefully it will help those who are still having similar issues...
Here are some similar issues (or some may be duplicates?) :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550682
http://<email address hidden>/msg700122.html
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550704
http://news.gmane.org/find-root.php?message_id=%3c20090908095706.GB31532%40plukwa.net%3e
http://article.gmane.org/gmane.linux.debian.devel.bugs.general/611442

The one particular explanation that seems to fit my case the best is one that occurred about a year ago in the grub mailing lists, where the bug was related to grub-probe (or lvm ?) mistaking an element of a RAID device as being an LVM physical volume.
In my case one of my physical volumes on my LVM is a 30GB mdadm raid0 device.
Of course this was considered resolved a year ago.
here's a link to that conversation:
http://<email address hidden>/msg06056.html

Again, something like that makes the most sense in my situation. I am having trouble getting the lvm moved off the mdadm raid0 device, so I can't yet test to see if that fixes it. I'm guessing I have a bit of data corruption on /dev/md0 (I get a no volume label for md0 error on "fdisk -l" . I'm doing some thorough scans on my VolGroup now.
If I resolve it I'll try and report back here.

Revision history for this message
Seth (bugs-sehe) wrote :

The post from Kamilion solved my problem also. +1

This was the diff 'sudo grub-mkdevicemap' explicitely:

sehe@karmic:~$ sdiff /home/sehe/oldboot/boot/grub/device.map /boot/grub/device.map
(hd0) /dev/sda (hd0) /dev/sda
(hd1) /dev/sdb (hd1) /dev/sdb
             > (hd2) /dev/sdc

Note that I had added an old harddisk to my system some time ago. This got recognized as sdb (!), moving my prior sdb to sdc. The killing detail, however, is that my root vg is striped across sda and sdc (in the new setup). Grub don't grok that !

So, IMHO the bug is that the device map _should_ have been checked/regenerated by update-grub, since upgrading kernel images will call update-grub only.

Revision history for this message
Brent Dunnaway (bdunnaway) wrote :

Mine ended up being the RAID-0 mdadm device that was a physical volume in my LVM2 Volume Group.
again see

When I got everything migrated off of it, the Ubuntu Karmic Alternate CD (Beta) installed grub2 with no segfaults.
I'm guessing the problem was how grub-probe detected the /dev/md0 segment of the 8 physical volumes that were in my LVM.
I'm installed now with my VG spread across about 5 physical volumes.

Of course it didn't see my Jaunty install or my XP install... but that is another issue :-)

So in the end mine was: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550682
(slightly different issue than what you guys are experiencing)

Revision history for this message
Seth (bugs-sehe) wrote :

It is still the same problem on my Karmic with full updates.

I still need to manually remember to run grub-mkdevicemap before update-grub or it will just fail. It might be due the fact that I switch and swap disks quite a few times. Still shouldn't render the system unbootable on kernel upgrades, IMHO!

Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
martin suchanek (martin-suc) wrote :

error is still there: grub-mount crashed with SIGSEGV in __libc_start_main()

apt-cache policy grub-common
grub-common:
  Installed: 2.00-7ubuntu11
  Candidate: 2.00-7ubuntu11
  Version table:
 *** 2.00-7ubuntu11 0
        500 http://archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages
        100 /var/lib/dpkg/status

lsb_release -rd
Description: Ubuntu 12.10
Release: 12.10

Revision history for this message
martin suchanek (martin-suc) wrote :
Download full text (15.0 KiB)

ProblemType: Crash
Architecture: amd64
CrashCounter: 1
Date: Thu Feb 21 08:53:05 2013
DistroRelease: Ubuntu 12.10
ExecutablePath: /usr/bin/grub-mount
ExecutableTimestamp: 1350236232
ProcCmdline: grub-mount /dev/sde5 /var/lib/os-prober/mount
ProcCwd: /
ProcEnviron:
 LANGUAGE=en_GB.UTF-8
 TERM=xterm
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcMaps:
 00400000-00474000 r-xp 00000000 103:0e 14029484 /usr/bin/grub-mount
 00674000-00675000 r-xp 00074000 103:0e 14029484 /usr/bin/grub-mount
 00675000-00678000 rwxp 00075000 103:0e 14029484 /usr/bin/grub-mount
 00678000-00707000 rwxp 00000000 00:00 0
 018ef000-01a40000 rwxp 00000000 00:00 0 [heap]
 7fde882f7000-7fde8dbb4000 r-xp 00000000 103:0e 4477580 /usr/lib/locale/locale-archive
 7fde8dbb4000-7fde8dbcc000 r-xp 00000000 103:0e 11047022 /lib/x86_64-linux-gnu/libpthread-2.15.so
 7fde8dbcc000-7fde8ddcb000 ---p 00018000 103:0e 11047022 /lib/x86_64-linux-gnu/libpthread-2.15.so
 7fde8ddcb000-7fde8ddcc000 r-xp 00017000 103:0e 11047022 /lib/x86_64-linux-gnu/libpthread-2.15.so
 7fde8ddcc000-7fde8ddcd000 rwxp 00018000 103:0e 11047022 /lib/x86_64-linux-gnu/libpthread-2.15.so
 7fde8ddcd000-7fde8ddd1000 rwxp 00000000 00:00 0
 7fde8ddd1000-7fde8ddd3000 r-xp 00000000 103:0e 11047037 /lib/x86_64-linux-gnu/libdl-2.15.so
 7fde8ddd3000-7fde8dfd3000 ---p 00002000 103:0e 11047037 /lib/x86_64-linux-gnu/libdl-2.15.so
 7fde8dfd3000-7fde8dfd4000 r-xp 00002000 103:0e 11047037 /lib/x86_64-linux-gnu/libdl-2.15.so
 7fde8dfd4000-7fde8dfd5000 rwxp 00003000 103:0e 11047037 /lib/x86_64-linux-gnu/libdl-2.15.so
 7fde8dfd5000-7fde8dfdc000 r-xp 00000000 103:0e 11047026 /lib/x86_64-linux-gnu/librt-2.15.so
 7fde8dfdc000-7fde8e1db000 ---p 00007000 103:0e 11047026 /lib/x86_64-linux-gnu/librt-2.15.so
 7fde8e1db000-7fde8e1dc000 r-xp 00006000 103:0e 11047026 /lib/x86_64-linux-gnu/librt-2.15.so
 7fde8e1dc000-7fde8e1dd000 rwxp 00007000 103:0e 11047026 /lib/x86_64-linux-gnu/librt-2.15.so
 7fde8e1dd000-7fde8e1e9000 r-xp 00000000 103:0e 11012631 /lib/x86_64-linux-gnu/libudev.so.0.13.0
 7fde8e1e9000-7fde8e3e8000 ---p 0000c000 103:0e 11012631 /lib/x86_64-linux-gnu/libudev.so.0.13.0
 7fde8e3e8000-7fde8e3e9000 r-xp 0000b000 103:0e 11012631 /lib/x86_64-linux-gnu/libudev.so.0.13.0
 7fde8e3e9000-7fde8e3ea000 rwxp 0000c000 103:0e 11012631 /lib/x86_64-linux-gnu/libudev.so.0.13.0
 7fde8e3ea000-7fde8e407000 r-xp 00000000 103:0e 11012621 /lib/x86_64-linux-gnu/libselinux.so.1
 7fde8e407000-7fde8e606000 ---p 0001d000 103:0e 11012621 /lib/x86_64-linux-gnu/libselinux.so.1
 7fde8e606000-7fde8e607000 r-xp 0001c000 103:0e 11012621 /lib/x86_64-linux-gnu/libselinux.so.1
 7fde8e607000-7fde8e608000 rwxp 0001d000 103:0e 11012621 /lib/x86_64-linux-gnu/libselinux.so.1
 7fde8e608000-7fde8e609000 rwxp...

Revision history for this message
martin suchanek (martin-suc) wrote :
Revision history for this message
martin suchanek (martin-suc) wrote :

crash in ubuntu raring as well

Revision history for this message
Rolf Leggewie (r0lf) wrote :

does this still affect xenial or later?

Changed in grub2 (Ubuntu):
assignee: nobody → Rolf Leggewie (r0lf)
status: Confirmed → Incomplete
Revision history for this message
Rolf Leggewie (r0lf) wrote :

closing as obsolete

Changed in grub2 (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.