bugGNU GRUB - Bugs: bug #62925, Out of memory error initializing...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #62925: Out of memory error initializing graphics on some Apple M1 systems

Submitter:  Hector Martin <marcan>
Submitted:  Sat 20 Aug 2022 11:32:41 AM UTC
   
 
Category:  Booting Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release:  Git master
Release:  Reproducibility:  Every Time
Planned Release:  None

Sat 20 Aug 2022 11:32:41 AM UTC, original submission:  

As of grub-2:2.06.r297.g0c6c1aff2-1-aarch64 as packaged by Arch Linux ARM (which is vanilla grub as of that git revision, other than grub.d patches and trivial packaging-related changes), initializing graphics fails on Apple M1 Pro MacBook 14" systems, and probably others, with an out of memory error. This leads to a degraded text console with broken menu graphic characters. This didn't happen with the previous package (grub-2.06.r261.g2f4430cc0-1).

The open source boot stack on these systems uses U-Boot as an EFI services provider. It seems GRUB is simply running out of heap as of recent changes. This trivial patch fixes it:


diff -urN grub-core/kern/efi/mm.c grub-core/kern/efi/mm.c
--- grub-core/kern/efi/mm.c     2022-08-20 20:17:23.975902981 +0900
+++ grub-core/kern/efi/mm.c     2022-08-20 20:17:16.268139945 +0900
@@ -39,7 +39,7 @@
 #define MEMORY_MAP_SIZE        0x3000

 /* The default heap size for GRUB itself in bytes.  */
-#define DEFAULT_HEAP_SIZE      0x100000
+#define DEFAULT_HEAP_SIZE      0x200000

 static void *finish_mmap_buf = 0;
 static grub_efi_uintn_t finish_mmap_size = 0;


Hector Martin <marcan>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by marcan (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.14-3b9d.
    Corresponding source code