diff --git a/crates/runtime/src/traphandlers/unix.rs b/crates/runtime/src/traphandlers/unix.rs index ef40b8c2c3..445646e6a5 100644 --- a/crates/runtime/src/traphandlers/unix.rs +++ b/crates/runtime/src/traphandlers/unix.rs @@ -286,7 +286,14 @@ pub fn lazy_per_thread_init() { /// The size of the sigaltstack (not including the guard, which will be /// added). Make this large enough to run our signal handlers. - const MIN_STACK_SIZE: usize = 16 * 4096; + /// + /// The main current requirement of the signal handler in terms of stack + /// space is that `malloc`/`realloc` are called to create a `Backtrace` of + /// wasm frames. + /// + /// Historically this was 16k. Turns out jemalloc requires more than 16k of + /// stack space in debug mode, so this was bumped to 64k. + const MIN_STACK_SIZE: usize = 64 * 4096; struct Stack { mmap_ptr: *mut libc::c_void,