[Concept,25/35] sandbox: Enable mcheck heap protection

Message ID 20251210000737.180797-26-sjg@u-boot.org
State New
Headers
Series malloc: Add heap debugging commands and mcheck caller tracking |

Commit Message

Simon Glass Dec. 10, 2025, 12:07 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Enable CONFIG_MCHECK_HEAP_PROTECTION for the sandbox board to detect
heap corruption during development and testing.

Increase the heap size from 96 MiB to 128 MiB to account for the
additional overhead of mcheck metadata (~48 bytes per allocation).

Increase the console-out buffer to 128K to allow space for the new
malloc dump, when checked in tests.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 configs/sandbox_defconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 44185ccb7eb..b1b2e725b4c 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -1,5 +1,5 @@ 
 CONFIG_TEXT_BASE=0
-CONFIG_SYS_MALLOC_LEN=0x6000000
+CONFIG_SYS_MALLOC_LEN=0x8000000
 CONFIG_BLOBLIST_SIZE_RELOC=0x20000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x2000
@@ -12,6 +12,7 @@  CONFIG_DEBUG_UART=y
 CONFIG_SYS_MEMTEST_START=0x00100000
 CONFIG_SYS_MEMTEST_END=0x00101000
 CONFIG_ULIB=y
+CONFIG_MCHECK_HEAP_PROTECTION=y
 CONFIG_EXAMPLES=y
 CONFIG_EFI_SECURE_BOOT=y
 CONFIG_EFI_RT_VOLATILE_STORE=y
@@ -49,7 +50,7 @@  CONFIG_IMAGE_PRE_LOAD=y
 CONFIG_IMAGE_PRE_LOAD_SIG=y
 CONFIG_CEDIT=y
 CONFIG_CONSOLE_RECORD=y
-CONFIG_CONSOLE_RECORD_OUT_SIZE=0x6000
+CONFIG_CONSOLE_RECORD_OUT_SIZE=0x20000
 CONFIG_PRE_CONSOLE_BUFFER=y
 CONFIG_LOG=y
 CONFIG_LOG_MAX_LEVEL=9