On Wed, May 09, 2007 at 12:37:03PM +0100, Sam Morris wrote:
> Here's a better backtrace, obtained one I patched the build system to
> respect DEB_BUILD_OPTIONS=noopt:
> 
>         #0  0x08048eb9 in probe (path=0xbfdd6e50 "/boot/grub")
>             at /tmp/x/grub2-1.95+20070507/util/i386/pc/grub-probe.c:129
>                 device_name = 0x806a138 "md0"
>                 drive_name = 0x806e408 "md0"
>                 dev = (grub_device_t) 0x806a028
>                 fs = (grub_fs_t) 0x805a315
>         #1  0x08049433 in main (argc=5, argv=0xbfdd52b4)
>             at /tmp/x/grub2-1.95+20070507/util/i386/pc/grub-probe.c:281
>                 dev_map = 0x806a008 "/boot/grub/device.map"
>                 path = 0xbfdd6e50 "/boot/grub"
> 
> The segfault happens because dev->disk->partition == NULL

Can you confirm that the attached patch converts the segfault into a proper
error?

Also, what is the result of "parted /dev/md0 print" ?

-- 
Robert Millan

My spam trap is [EMAIL PROTECTED]  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
--- util/i386/pc/grub-probe.c~	2007-05-07 21:54:46.000000000 +0200
+++ util/i386/pc/grub-probe.c	2007-05-09 15:56:08.000000000 +0200
@@ -126,6 +126,9 @@
 
   if (print == PRINT_PARTMAP)
     {
+      if (dev->disk->partition == NULL)
+        grub_util_error ("Cannot detect partition map for %s", drive_name);
+
       if (strcmp (dev->disk->partition->partmap->name, "amiga_partition_map") == 0)
         printf ("amiga\n");
       else if (strcmp (dev->disk->partition->partmap->name, "apple_partition_map") == 0)

Reply via email to