Skip to content

Commit 149047e

Browse files
committed
rt: Set the stack depth limit to 1GB. Abort on error.
People hit the recursion depth limit too often, it's not possible to unwind reliably from out-of-stack. Issues #3555, #3695
1 parent 64412ec commit 149047e

File tree

6 files changed

+3
-86
lines changed

6 files changed

+3
-86
lines changed

src/rt/rust_env.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ get_max_stk_size() {
9797
return strtol(maxsz, NULL, 0);
9898
}
9999
else {
100-
return 1024*1024*8;
100+
return 1024*1024*1024;
101101
}
102102
}
103103

src/rt/rust_task.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,11 @@ rust_task::new_stack(size_t requested_sz) {
530530
// arbitrarily selected as 2x the maximum stack size.
531531
if (!unwinding && used_stack > max_stack) {
532532
LOG_ERR(this, task, "task %" PRIxPTR " ran out of stack", this);
533-
fail();
533+
abort();
534534
} else if (unwinding && used_stack > max_stack * 2) {
535535
LOG_ERR(this, task,
536536
"task %" PRIxPTR " ran out of stack during unwinding", this);
537-
fail();
537+
abort();
538538
}
539539

540540
size_t sz = rust_stk_sz + RED_ZONE_SIZE;

src/test/run-fail/issue-2144.rs

-19
This file was deleted.

src/test/run-fail/out-of-stack-managed-box.rs

-25
This file was deleted.

src/test/run-fail/out-of-stack-owned-box.rs

-21
This file was deleted.

src/test/run-fail/too-much-recursion.rs

-18
This file was deleted.

0 commit comments

Comments
 (0)