Skip to content

rt: Release big stacks immediately after use to avoid holding on to them... #6581

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

Conversation

brson
Copy link
Contributor

@brson brson commented May 18, 2013

... through yields

r? @pcwalton

This avoids the following pathological scenario that makes threadring OOM:

  1. task calls C using fast_ffi, borrowing a big stack from the scheduler.
  2. task returns from C and places the big stack on the task-local stack segment list
  3. task calls further Rust functions that require growing the stack, and for this reuses the big stack
  4. task yields, failing to return the big stack to the scheduler.
  5. repeat 500+ times and OOM

Fixes #5985

…hem through yields

This avoids the following pathological scenario that makes threadring OOM:

1) task calls C using fast_ffi, borrowing a big stack from the scheduler.
2) task returns from C and places the big stack on the task-local stack segment list
3) task calls further Rust functions that require growing the stack, and for this reuses the big stack
4) task yields, failing to return the big stack to the scheduler.
5) repeat 500+ times and OOM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants