Skip to content

Commit 7fb92c9

Browse files
Nicolas Pitrekartben
authored andcommitted
tests: lib: multi_heap: fix stack overflow
Some platforms, notably ARM64, need more than 512 bytes of breathing room on the stack. Very weird and difficult-to-track memory corruptions were caused by test_mheap_realloc without this. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
1 parent 294a26b commit 7fb92c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/lib/multi_heap/src/test_mheap_api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
#include "test_mheap.h"
1212

1313
#define MALLOC_IN_THREAD_STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE)
14-
#define INCREMENTAL_FILL_STACK_SIZE (512 + (BLK_NUM_MAX * sizeof(void *) * 2))
14+
#define INCREMENTAL_FILL_STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE + \
15+
(BLK_NUM_MAX * sizeof(void *) * 2))
1516
#define OVERFLOW_SIZE SIZE_MAX
1617

1718
#define NMEMB 8

0 commit comments

Comments
 (0)