Skip to content

rt: Set the stack depth limit to 1GB. Abort on error. #6081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rt/rust_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ get_max_stk_size() {
return strtol(maxsz, NULL, 0);
}
else {
return 1024*1024*8;
return 1024*1024*1024;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/rt/rust_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,11 @@ rust_task::new_stack(size_t requested_sz) {
// arbitrarily selected as 2x the maximum stack size.
if (!unwinding && used_stack > max_stack) {
LOG_ERR(this, task, "task %" PRIxPTR " ran out of stack", this);
fail();
abort();
} else if (unwinding && used_stack > max_stack * 2) {
LOG_ERR(this, task,
"task %" PRIxPTR " ran out of stack during unwinding", this);
fail();
abort();
}

size_t sz = rust_stk_sz + RED_ZONE_SIZE;
Expand Down
19 changes: 0 additions & 19 deletions src/test/run-fail/issue-2144.rs

This file was deleted.

25 changes: 0 additions & 25 deletions src/test/run-fail/out-of-stack-managed-box.rs

This file was deleted.

21 changes: 0 additions & 21 deletions src/test/run-fail/out-of-stack-owned-box.rs

This file was deleted.

18 changes: 0 additions & 18 deletions src/test/run-fail/too-much-recursion.rs

This file was deleted.