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

no support for full stack safety provided by a guard page #10781

Closed
thestinger opened this issue Dec 3, 2013 · 2 comments
Closed

no support for full stack safety provided by a guard page #10781

thestinger opened this issue Dec 3, 2013 · 2 comments
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@thestinger
Copy link
Contributor

Rust should have a way to output a call to a chkstk-like function for frames larger than the guard size. LLVM has support for chkstk so this could be leveraged on other platforms too. The Linux pthread API provides pthread_getattr_np so the available stack space can be checked.

Here's the documentation for the GCC support:

http://gcc.gnu.org/onlinedocs/gccint/Stack-Checking.html

@alexcrichton
Copy link
Member

This bug may not be so much as we don't have support for this but rather we're just not doing this. We're not using segmented stacks the way that they're supposed to be used in the compiler, and our strategy on all platforms should align with that of chkstk. I've looked into LLVM and it is indeed implemented, but it's all special-cased on codegen for the windows platform.

To pursue this, we will need to modify to accept an option to codegen chkstk on all platforms, hopefully take a symbol as well (so we can implement our own), and then implement the necessary prologue for all our platforms and architectures (I have a feeling that LLVM only implements it for x86 windows right now).

It would probably be worth chatting with the upstream LLVM guys before pursuing this just to make sure that we're aligned correctly in how to do this.

@thestinger
Copy link
Contributor Author

Closing in favour of #16012.

flip1995 pushed a commit to flip1995/rust that referenced this issue May 20, 2023
flip1995: Stepping down from the reviewer rotation

A step I was trying to avoid for way too long, but sadly necessary now. I hope I can come back stronger in a few months.

More explanation on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Stepping.20back.20from.20review.20rotation/near/358384096)

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

2 participants