Commit 025375d
boards: qemu: leon3: pass -m 1G to match DTS SRAM size
The qemu_leon3 DTS declares 1GB of SRAM (reg = <0x40000000 0x40000000>)
but the QEMU command line never specified a -m option, so QEMU used its
default of 128MB. This mismatch was silently tolerated until now because
nothing validated the heap's end marker beyond physical RAM.
When CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=-1 (the default), the malloc
heap claims the entire declared SRAM (~1GB). The heap end marker chunk
is written at ~1GB offset from the heap base, well beyond QEMU's 128MB
of physical RAM. Those writes are silently lost, leaving the end
marker's LEFT_SIZE field as zero.
Commit bec6349 ("lib: heap: introduce SYS_HEAP_HARDENING tiered
Kconfig") made bidirectional size round-trip checks the default when
CONFIG_ASSERT=y (MODERATE level). The check left_chunk(right_chunk(c))
reads back the end marker's LEFT_SIZE and detects the zero value,
triggering "heap corruption (free chunk linkage)" across many unrelated
tests on this board.
Add -m 1G to the QEMU flags so the emulated RAM matches the declared
DTS size, consistent with how other QEMU boards (arc, riscv32, x86)
already specify their memory.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>1 parent 2d747e5 commit 025375d
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
0 commit comments