Skip to content
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

Clarify the stack exhaustion story for a task #9855

Closed
alexcrichton opened this issue Oct 14, 2013 · 2 comments
Closed

Clarify the stack exhaustion story for a task #9855

alexcrichton opened this issue Oct 14, 2013 · 2 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

Comments

@alexcrichton
Copy link
Member

Right now, the current behavior for a task on stack exhaustion is to attempt to unwind. This "works" because a task allocates itself 10k more stack in order to begin unwinding, and then prays that destructors don't re-overflow the stack.

Right now re-overflowing results in an abort of the runtime, but this is not the best behavior. There's a few routes we could take:

  • We have "unlimited stacks" in theory (good ol' 64-bit address spaces), so perhaps just allocating an extra megabyte for this use case would be "enough"
  • Continue to fail everything
  • "Taint" the current task on second overflow, immediately context-switch away, and then leak the entire task (no destructors are run).
@alexcrichton
Copy link
Member Author

Nominating for high priority.

@alexcrichton
Copy link
Member Author

Closing in favor of #3695

flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 21, 2022
… r=xFrednet

Extend `needless_borrowed_reference` to structs and tuples, ignore _

changelog: [`needless_borrowed_reference`]: Lint struct and tuple patterns, and patterns containing `_`

Now lints patterns like

```rust
&(ref a, ref b)
&Tuple(ref a, ref b)
&Struct { ref a, ref b }

&(ref a, _)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Projects
None yet
Development

No branches or pull requests

1 participant