about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp12
1 files changed, 11 insertions, 1 deletions
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;