Bug#616638: using the "linux" command twice in a row causes grub-efi-amd64 to hang

Colin Watson cjwatson at debian.org
Tue Mar 8 10:26:59 UTC 2011


On Sun, Mar 06, 2011 at 02:37:42AM -0500, Daniel Kahn Gillmor wrote:
> Booting grub-efi directly on a new macbook pro, i found that if i
> accidentally did:
> 
>  linux (hd1,gpt2)/vmlinuz root=/dev/sda3 ro verbose
>  linux (hd1,gpt2)/vmlinuz root=/dev/sda3 ro verbose
> 
> (that is, if i loaded the kernel twice) then grub would hang.
> 
> Other variants of grub (grub-pc and grub-ieee1275) don't seem to show
> this behavior.
> 
> I also note that if my second command points to something that is not
> a file, grub does *not* hang.

There's a fairly small number of differences between BIOS and EFI that
might be relevant to the 'linux' command.  One of them is memory
allocation, so I looked through that code path, and I noticed one bug by
inspection that could certainly cause your problem.  Could you try this
patch?

=== modified file 'grub-core/loader/i386/linux.c'
--- grub-core/loader/i386/linux.c	2011-01-10 23:02:01 +0000
+++ grub-core/loader/i386/linux.c	2011-03-08 10:24:17 +0000
@@ -136,7 +136,8 @@ find_efi_mmap_size (void)
      later, and EFI itself may allocate more.  */
   mmap_size += (1 << 12);
 
-  return page_align (mmap_size);
+  mmap_size = page_align (mmap_size);
+  return mmap_size;
 }
 
 #endif

-- 
Colin Watson                                       [cjwatson at debian.org]





More information about the Pkg-grub-devel mailing list