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
Unexpected difference in LLVM and cargo-call-stack size for untyped functions #65
Comments
yes, I assume the machine code analysis is not handling the sp decrement in that first |
I got this the wrong way around! The sp value is calculated correctly by cargo-call-stack, but the analysis from stack-sizes claims 0 stack usage for all the outlined functions. Using |
if the map does contain the is the code that runs into the issue public? if not, could you run
|
The only output with OUTLINED_FUNCTION is this:
The project is public, you can find it here: https://github.com/drogue-iot/drogue-device/tree/main/examples/nrf52/microbit/bt-mesh running |
thanks for the link. I had a look and this seems to be a llvm bug. all the I couldn't find a bug report and would have a hard time producing a small repro case to submit a bug report so I'll pass on that. I'll add some workarounds to call-stack to deal with this. |
as of version 14.0.6, the outlined functions produced by one of LLVM's optimization passes do not get assigned a correct stack size by LLVM's emit-stack-sizes pass to work around the issue use the stack usage obtained from analyzing the machine code (ARM Cortex-M only) instead of the stack usage reported by LLVM also, avoid producing warnings about not having type information for outlined functions. so far all these outlined functions appear to be called directly and never via a function pointer closes #65
68: add heuristics to deal with outlined functions r=japaric a=japaric as of version 14.0.6, the outlined functions produced by one of LLVM's optimization passes do not get assigned a correct stack size by LLVM's emit-stack-sizes pass to work around the issue use the stack usage obtained from analyzing the machine code (ARM Cortex-M only) instead of the stack usage reported by LLVM also, avoid producing warnings about not having type information for outlined functions. so far all these outlined functions appear to be called directly and never via a function pointer closes #65 Co-authored-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
v0.1.11 includes a workaround for this issue |
I have an application that triggers this assert in
cargo-call-stack
:originating from this code
Running objdump reveals the instructions for OUTLINED_FUNCTION_13:
And it looks like it is supposed to use 8 bytes of stack.
Is the correct way forward to modify the thumb.rs to catch this sp modification so that the calculated value is correct?
The text was updated successfully, but these errors were encountered: