[LLVMbugs] [Bug 24167] New: ASan is incompatible with SEH and llvm.localescape

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 17 10:36:08 PDT 2015


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

            Bug ID: 24167
           Summary: ASan is incompatible with SEH and llvm.localescape
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedbugs at nondot.org
          Reporter: rnk at google.com
                CC: eugeni.stepanov at gmail.com, kcc at google.com,
                    llvmbugs at cs.uiuc.edu, timurrrr at google.com,
                    vonosmas at gmail.com
    Classification: Unclassified

SEH uses llvm.localescape to share a local static alloca with other functions.
ASan thinks it can RAUW the alloca with a GEP+bitcast of a new, possibly
dynamic, alloca. That doesn't work for a few reasons:

1. ASan fails to preserve IR validity by moving llvm.localescape out of the
entry block. This is easy to fix.

2. The arguments to llvm.localescape must be casts of static allocas. We could
relax this to an offset into a static alloca and fold the offset into the asm
label we use.

3. The argument to llvm.localescape must be a static alloca. It cannot be a
dynamic alloca. This conflicts with ASan UAR as well. I think this can only be
fixed in ASan, because the runtime gives us one pointer to work with: the frame
or stack pointer. We have to be able to recover the address of the local
variable from that with offset arithmetic.

-- 
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/20150717/9e6c55d3/attachment.html>


More information about the llvm-bugs mailing list