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

Remove fixed_stack_segment #10407

Merged
merged 2 commits into from
Nov 11, 2013
Merged

Conversation

alexcrichton
Copy link
Member

The commit messages have more details, but this removes all analysis and usage related to fixed_stack_segment and rust_stack attributes. It's now the assumption that we always have "enough stack" and we'll implement detection of stack overflow through other means.

The stack overflow detection is currently implemented for rust functions, but it is unimplemented for C functions (we still don't have guard pages).

@brson
Copy link
Contributor

brson commented Nov 11, 2013

Hooray for removing features!

These two attributes are no longer useful now that Rust has decided to leave
segmented stacks behind. It is assumed that the rust task's stack is always
large enough to make an FFI call (due to the stack being very large).

There's always the case of stack overflow, however, to consider. This does not
change the behavior of stack overflow in Rust. This is still normally triggered
by the __morestack function and aborts the whole process.

C stack overflow will continue to corrupt the stack, however (as it did before
this commit as well). The future improvement of a guard page at the end of every
rust stack is still unimplemented and is intended to be the mechanism through
which we attempt to detect C stack overflow.

Closes rust-lang#8822
Closes rust-lang#10155
I increased this to 4MB when I implemented abort-on-stack-overflow for Rust
functions. Now that the fixed_stack_segment attribute is removed, no rust
function will ever reasonably request 2MB of stack (due to calling an FFI
function).

The default size of 2MB should be plenty for everyday use-cases, and tasks can
still request more stack via the spawning API.
bors added a commit that referenced this pull request Nov 11, 2013
The commit messages have more details, but this removes all analysis and usage related to fixed_stack_segment and rust_stack attributes. It's now the assumption that we always have "enough stack" and we'll implement detection of stack overflow through other means.

The stack overflow detection is currently implemented for rust functions, but it is unimplemented for C functions (we still don't have guard pages).
@bors bors closed this Nov 11, 2013
@bors bors merged commit 1f19243 into rust-lang:master Nov 11, 2013
@alexcrichton alexcrichton deleted the no-fixed-stack-segment branch November 13, 2013 22:20
flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 24, 2023
Use uninit checking from rustc

rustc has proper heuristics for actually checking whether a type allows being left uninitialized (by asking CTFE). We can now use this for our helper instead of rolling our own bad version with false positives.

I added this in rustc in rust-lang#108669

Fix rust-lang#10407

changelog: [`uninit_vec`]: fix false positives
changelog: [`uninit_assumed_init`]: fix false positives
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.

None yet

3 participants