<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 - __cxa_exception doesn't match Itanium spec."
   href="https://bugs.llvm.org/show_bug.cgi?id=41397">41397</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__cxa_exception doesn't match Itanium spec.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++abi
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>eric@efcs.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21739" name="attach_21739" title="libstdcxx_test.cpp">attachment 21739</a> <a href="attachment.cgi?id=21739&action=edit" title="libstdcxx_test.cpp">[details]</a></span>
libstdcxx_test.cpp

To support C++11 exception point, we added a ref count member at the start of
the `__cxa_exception` type. However, `__cxa_exception` is specified by the
Itanium spec and in the specification it doesn't contain the new member.

Since `__cxa_exception` is part of the ABI specification, users may declare
their own copy of it and then attempt to access in-flight exceptions using
`__cxa_get_globals()`.

When this occurs the members of the `__cxa_exception` objects are at the wrong
offsets and this can break users.

GCC's fixs to this problem was to keep `__cxa_exception`'s layout and put the
refcount in a new type `__cxa_refcounted_exception` [1]. We should consider
doing similar.


[1] <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38732">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38732</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>