<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - SEH unwinding breaks in the presence of a jump-table on Windows/AArch64"
   href="https://bugs.llvm.org/show_bug.cgi?id=41581">41581</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SEH unwinding breaks in the presence of a jump-table on Windows/AArch64
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>8.0
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>gsvelto@mozilla.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We encountered this issue when building Firefox for Windows/AArch64 using clang
8.0.0 [1]. The issue was introduced in [2].

What's happening is that we install an exception handler with
`SetUnhandledExceptionFilter()` [3] to gather crash dumps. Starting with
clang-8.0.0 this stopped working in many cases; when we encountered an
exception Windows would be unable to unwind the stack and reach the exception
handler, bailing out if it encountered a frame pointing to the JavaScript
interpreter [3] on the stack. The interpreter uses macros to generate a large
jump-table and [2] changed in which section the jump-table contents are stored.
This seems to confuse Windows' unwinding machinery which simply bails out when
encountering a frame that jumped through that table.

I've compared the code emitted w/ and w/o [2] applied and the only difference
are the section directives around the jump table. I can attach the relevant
assembly output if needed but it's very, very large.

I'm working on a reduced test-case and I'll attach it ASAP.

[1] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1542827">https://bugzilla.mozilla.org/show_bug.cgi?id=1542827</a>
[2]
<a href="https://github.com/llvm/llvm-project/commit/502c6557aa1aa6917fe5ce0ee26cfe936d45eb98">https://github.com/llvm/llvm-project/commit/502c6557aa1aa6917fe5ce0ee26cfe936d45eb98</a>
[3]
<a href="https://searchfox.org/mozilla-central/rev/ec489aa170b6486891cf3625717d6fa12bcd11c1/js/src/vm/Interpreter.cpp#1653-4424">https://searchfox.org/mozilla-central/rev/ec489aa170b6486891cf3625717d6fa12bcd11c1/js/src/vm/Interpreter.cpp#1653-4424</a></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>