From b42c6d07dc4b1aeb66901bd29b14ab34f9ef1183 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 9 Apr 2012 15:26:41 -0700 Subject: rt: Don't limit the amount of stack available during unwinding. Closes #2144 --- src/rt/rust_task.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/rt/rust_task.cpp') diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index e1bc74e53df..b0ced523390 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -514,7 +514,17 @@ rust_task::new_stack(size_t requested_sz) { if (total_stack_sz + rust_stk_sz > kernel->env->max_stack_size) { LOG_ERR(this, task, "task %" PRIxPTR " ran out of stack", this); - fail(); + if (!unwinding) { + fail(); + } else { + // FIXME: Because we have landing pads that may need more + // stack than normally allowed we have to go allow the stack + // to grow unbounded during unwinding. Would be nice to + // have a different solution - maybe just double the limit. + LOG_ERR(this, task, "task %" PRIxPTR " has blown its stack " + "budget but we are unwinding so growing the stack " + "anyway"); + } } size_t sz = rust_stk_sz + RED_ZONE_SIZE; -- cgit 1.4.1-3-g733a5