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

Reduce the Rust stack red zone #1509

Closed
brson opened this issue Jan 13, 2012 · 4 comments
Closed

Reduce the Rust stack red zone #1509

brson opened this issue Jan 13, 2012 · 4 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@brson
Copy link
Contributor

brson commented Jan 13, 2012

Right now the stack red zone is 20K on all platforms, which is ~20K larger than we would like. Several considerations:

  • The dynamic linker performs lazy binding in the red zone. Lazy binding can be turned off.
  • Landing pads call _Unwind_Resume in the red zone. We can probably come up with a scheme to switch stacks for this, but even better will be to implement our own unwinding.
  • There is some logging happening in the red zone that only shows up with RUST_LOG set appropritiately.
  • There is at least one upcall still doing a lot of work in the red zone.
  • We need to be able to handle signals in the red zone, haven't put any thought into it yet.
@pcwalton
Copy link
Contributor

For the last one, what about sigaltstack(2)?

@jckarter
Copy link

For some platforms you could handle the last point with sigaltstack, but (afaik) there isn't an equivalent to sigaltstack on Windows, and sigaltstack + pthreads is busted on some lesser platforms, OpenBSD at least.

@ghost ghost assigned brson Apr 12, 2012
@msullivan
Copy link
Contributor

brson says that the linux red zone, at least, is down to 2k.

I'm marking this as milestone 5.

@thestinger
Copy link
Contributor

This may or may not still be an issue with a new segmented stack implementation, so it can be closed for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

5 participants