<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW " title="NEW --- - ASan is incompatible with SEH and llvm.localescape" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24167&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=SkYVCBU9z75_pH5NcR9wqNi0BZwUych9VPtb7QCC44c&s=TmLTGPjO8UV9WfqhUAP7xLNk_oqLlvNWpBwxT8kihH0&e=">24167</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ASan is incompatible with SEH and llvm.localescape
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Transformation Utilities
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rnk@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>eugeni.stepanov@gmail.com, kcc@google.com, llvmbugs@cs.uiuc.edu, timurrrr@google.com, vonosmas@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>