Bug#500482: Segmentation fault in grub-probe

Guillem Jover guillem.jover at nokia.com
Mon Oct 27 21:43:40 UTC 2008


severity 500482 serious
tags 500482 - unreproducible moreinfo
tags 500482 + patch
thanks

Hi,

Setting severity to serious (not grave) as this does not affect
everyone, but if it does prevents installing kernels. But of course
adjust if you disagree.

On Sun, 2008-10-26 at 12:17:28 -0700, Steve Langasek wrote:
> I have tried to reproduce this with the following (comparable, but not
> identical) configuration:
> 
> - install lenny using the daily d-i images
> - configure hda1, hdb1 as a 5GB RAID1 /dev/md0, add an ext3 filesystem on
>   top of it
> - create 1GB swap on hda2, hdb2
> - create a 17GB RAID1 /dev/md1 on hda3 and hdb3
> - create a 17GB RAID1 /dev/md2 on hda4 and hdb4
> - create a RAID0 /dev/md3 over /dev/md1 and /dev/md2 with 16KiB chunk size
> - pvcreate /dev/md3
> - add /dev/md3 to a VG
> - create a LV on the VG
> - run grub-probe -d /dev/md0
> - result: 'ext2' is printed; no segfault.
>
> If you're still able to reproduce this problem, please respond to Felix's
> requests for more information, because as far as I can see this bug is
> unreproducible in lenny.

One of the internal boxes at Nokia had this same problem, it does not
have any software RAID nor any LVM setup, but on /dev/sda3 there seems
to be remains of what used to be a LV.

> If you can reproduce the bug, then please run grub-probe under gdb and
> provide a backtrace.

Ok even better, just cooked a patch. The problem was that the error
recovery code is buggy, and it inserts data structures and does not
take them out in case of error unwinding, which happens in this case.
I opted to delay the insertion until a point were the code cannot
fail. I also check for an additional possible returned NULL.

Attached the patch.

regards,
guillem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lvm-Fix-error-recovery-by-only-adding-objects-when.patch
Type: text/x-diff
Size: 0 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20081027/2ad690e0/attachment.patch 


More information about the Pkg-grub-devel mailing list