[llvm-bugs] [Bug 41397] New: __cxa_exception doesn't match Itanium spec.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 5 11:42:28 PDT 2019


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

            Bug ID: 41397
           Summary: __cxa_exception doesn't match Itanium spec.
           Product: libc++abi
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: eric at efcs.ca
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Created attachment 21739
  --> https://bugs.llvm.org/attachment.cgi?id=21739&action=edit
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] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38732

-- 
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/20190405/46677fe8/attachment.html>


More information about the llvm-bugs mailing list