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

XRay trampolines may leave the stack unaligned #34642

Closed
llvmbot opened this issue Nov 14, 2017 · 2 comments
Closed

XRay trampolines may leave the stack unaligned #34642

llvmbot opened this issue Nov 14, 2017 · 2 comments
Labels
bugzilla Issues migrated from bugzilla xray

Comments

@llvmbot
Copy link
Member

llvmbot commented Nov 14, 2017

Bugzilla Link 35294
Resolution FIXED
Resolved on Jun 13, 2018 10:59
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @hfinkel

Extended Description

In some situations when the XRay tracing system has been turned off in the middle of the execution of any one of __xray_Function{Entry,Exit,TailExit} and __xray_ArgLoggerEntry and the handlers have been un-installed, we could be left in an unaligned stack state.

In other cases, we might have a handler that doesn't leave the stack aligned in a specific state after returning, and could be in a situation where the stack is unaligned after the instrumentation is turned off.

We should fix the trampolines to adhere to the Linux x86_64 ABI and align the stack to 16-byte addresses always before calling a function, and re-aligning the stack before restoring the state of the registers and returning. In particular, we already do this correctly for the __xray_CustomEvent trampoline, we just need to port the same implementation across the other trampolines.

@llvmbot
Copy link
Member Author

llvmbot commented Dec 12, 2017

Fixed in r318261.

@llvmbot
Copy link
Member Author

llvmbot commented Jun 13, 2018

*** Bug #31998 has been marked as a duplicate of this bug. ***

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla xray
Projects
None yet
Development

No branches or pull requests

1 participant