-
Notifications
You must be signed in to change notification settings - Fork 99
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
Expose the -warn-stack-size= LLVM option somehow #79
Comments
In theory I'm looking at the LLVM source code and it seems that there's some option to emit (as debug logs?) the number of stack bytes that each function uses. I have no idea how to make rustc print these statistics though. |
@japaric I think you need to call |
Hey @japaric, I know you've done some work exposing stack usage, is this issue still open/relevant? |
@jamesmunns the work I did was related to #106. The llvm feature described here is a different feature. |
@japaric do you think this should stay open? If so, please remove the cleanup tag. |
@jamesmunns not sure, but I can tell you that I don't intend to work on this one. We don't really have a policy for keeping "interesting project" issues around. Perhaps this could be moved into the "not yet awesome embedded Rust" list? Then we can close this issue. |
Closing this issue as part of today's triage. I'm sure there's still work to be done on improving stack size handling and overflow detection, but no one in the WG is currently planning to do it. There have been some interesting developments in handling stack overflows, such as flip-link, and newer Arm cores even have stack limit registers that are checked in hardware. |
I've just learned that LLVM can, in fact, do a limited stack size analysis: https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20130603/177010.html.
It's not interprocedural but I think it's still quite useful e.g. if LLVM ends up allocating a large array on stack, which seems to be a source of stack overflows that might be on the second place after recursion IME.
The text was updated successfully, but these errors were encountered: