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

Stack overflow should not abort, it should fail!() #11011

Closed
alexcrichton opened this issue Dec 17, 2013 · 4 comments
Closed

Stack overflow should not abort, it should fail!() #11011

alexcrichton opened this issue Dec 17, 2013 · 4 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows P-low Low priority

Comments

@alexcrichton
Copy link
Member

There are a lot of issues surrounding doing this soundly, but this is what we should be doing.

Related issues:
#2361

#3695
#3555
#9855
#9854

There is also a large comment in rust_stack_exhausted that goes into more details about the trickiness of implementing this correctly.

@flaper87
Copy link
Contributor

flaper87 commented May 6, 2014

Visiting for triage.

Most of the bugs listed in the report were closed in favor of other bugs and they point to this one - directly or indirectly. I think it is worth to start discussing this issue and have a clear plan / implementation before 1.0. Nominating.

@alexcrichton
Copy link
Member Author

Not a 1.0 issue, P-low

@thestinger
Copy link
Contributor

It's fundamentally impossible to do this because it would cause undefined behaviour. Using stack probes, a stack overflow can occur on any write to the stack, and it's completely undefined to unwind from an arbitrary point. It would be impossible to write memory safe low-level code and LLVM also doesn't support an exception model with arbitrary unwinding points like that. With the segmented stack preludes, they are injected during code generation which is too late to have well defined unwinding. The ability for every function to unwind would also result in the impossibility of writing correct low-level code.

@steveklabnik
Copy link
Member

A change like this would be a very large one today; I haven't heard anyone clamoring for this in a while. We have been changing the way that some of this happens; notably, #31333

as such, i'm giving it a close.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
…affate

New lint [`redundant_at_rest_pattern`]

Closes rust-lang#11011

It's always a great feeling when a new lint triggers on clippy itself 😄

changelog: New lint [`redundant_at_rest_pattern`]
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 P-low Low priority
Projects
None yet
Development

No branches or pull requests

5 participants