Skip to content

Commit 4d2eea3

Browse files
committed
wamr: bump the default stack guard size
using 0 by default seems a bit too aggressive to me. 1024 here is what would have been used before this kconfig knob was introduced by #1259. It also matches some expectations in the recent wamrc. https://github.com/bytecodealliance/wasm-micro-runtime/blob/40b430fd240ad45f5c7a7dd0239fa2425e7c294e/core/iwasm/compilation/aot_emit_aot_file.c#L2672-L2678
1 parent 730370e commit 4d2eea3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

interpreters/wamr/Kconfig

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,18 @@ config INTERPRETERS_WAMR_ENABLE_SPEC_TEST
103103

104104
config INTERPRETERS_WAMR_STACK_GUARD_SIZE
105105
int "Custom stack guard size"
106-
default 0
106+
default 1024
107107
---help---
108-
Reserve some space in stack as guard to detect stack overflow,
109-
use stack base by default but may not safe enough.
108+
Reserve some space in stack as guard to detect stack overflow.
109+
110+
Please consider this extra stack consumption when deciding the stack
111+
size of your NuttX task on which you run WAMR.
112+
113+
The default value here (1024) was chosen to match the default value on
114+
the majority of other platforms, including Linux. It also matches
115+
the expections in the WAMR AoT compiler.
116+
On the other hand, it might be a bit larger than what's strictly
117+
necessary, especially for typical NuttX targets.
110118

111119
config INTERPRETERS_WAMR_THREAD_MGR
112120
bool "Enable thread manager"

0 commit comments

Comments
 (0)