-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change stack walking to stop at a precise fp (#9420)
* Change stack walking to stop at a precise fp Prior to this commit entry trampolines into wasm would record their stack pointer at the time of the function call to wasm and then this stack pointer was used to halt the stack walking process. The problem with this though is that due to the `tail` ABI it's possible that the callee will update the caller's stack pointer temporarily. This means that the recorded stack pointer at the time the trampoline called wasm may differ from the callee's idea of what the stack pointer is when a backtrace happens. To handle this condition when stack walking the frame pointer instead of the stack pointer is now recorded when wasm is invoked. This frame pointer is a trusted value as it's managed by Cranelift itself. This additionally enables the stop condition for frame walking to be a precise "it must be this value" condition. Put together this commit fixes an issue where when `return_call` is used it's possible for the initial few frames of the stack to get lost in stack traces. After this the frame pointer chain should always be precisely walked in its entirety, even in the face of different numbers of arguments and parameters as `return_call` instructions are executed. * Add tail-calls, params, and results to stacks fuzzer This commit extends the preexisting `stacks` fuzzer with a few new features: * `return_call` instructions are now generated * functions may have both params/results to exercise logic around stack adjustments and how that might affect a stack trace
- Loading branch information
1 parent
151c0f7
commit de469e2
Showing
14 changed files
with
236 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.