[llvm-bugs] [Bug 35294] New: XRay trampolines may leave the stack unaligned

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 13 23:07:09 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35294

            Bug ID: 35294
           Summary: XRay trampolines may leave the stack unaligned
           Product: XRay
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Runtime
          Assignee: dberris at google.com
          Reporter: dberris at google.com
                CC: llvm-bugs at lists.llvm.org

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171114/d23d6f41/attachment.html>


More information about the llvm-bugs mailing list