History log of /freebsd-11-stable/contrib/libcxxrt/exception.cc
Revision Date Author Comments
# 369446 10-Mar-2021 git2svn

Partially revert libcxxrt changes to avoid _Unwind_Exception change

After the recent cherry-picking of libcxxrt commits 0ee0dbfb0d26 and
d2b3fadf2db5, users reported that editors/libreoffice packages from the
official package builders did not start anymore. It turns out that the
combination of these commits subtly changes the ABI, requiring all
applications that depend on internal details of struct _Unwind_Exception
(available via unwind-arm.h and unwind-itanium.h) to be recompiled.

However, the FreeBSD package builders always use -RELEASE jails, so
these still use the old declaration of struct _Unwind_Exception, which
is not entirely compatible. In particular, LibreOffice uses this struct
in its internal "uno bridge" component, where it attempts to setup its
own exception handling mechanism.

To fix this incompatibility, go back to the old declarations of struct
_Unwind_Exception, and restore the __LP64__ specific workaround we had
in place before (which was to cope with yet another, older ABI bug).

Effectively, this reverts upstream libcxxrt commits 88bdf6b290da
("Specify double-word alignment for ARM unwind") and b96169641f79
("Updated Itanium unwind"), and reapplies our commit 3c4fd2463bb2
("libcxxrt: add padding in __cxa_allocate_* to fix alignment").

PR: 253840

Git Hash: 3a5074327da0ceba770aef60e41e91dc7d054019
Git Author: dim@FreeBSD.org


# 369332 21-Feb-2021 dim

Merge libcxxrt master 8049924686b8414d8e652cbd2a52c763b48e8456

Interesting fixes:
b3c73ba libelftc_dem_gnu3: Sync with elftoolchain r3877
7b2335c Mostly fix __cxa_demangle after #3

Reported by: arichardson
PR: 253226

(cherry picked from commit 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368)

Revert 3c4fd2463bb2 since upstream libcxxrt fixed it in another way

In 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 I imported a more recent
libcxxrt snapshot, which includes an upstream fix for the padding of
struct _Unwind_Exception:

https://github.com/libcxxrt/libcxxrt/commit/e458560b7e22fff59af643dba363544b393bd8db

However, we also had a similar fix in our tree as:
https://cgit.freebsd.org/src/commit/?id=3c4fd2463bb29f65ef1404011fcb31e508cdf2e2

Since having both fixes makes the struct too large again, it leads to
SIGBUSes when throwing exceptions on amd64 (or other LP64 arches). This
is most easily tested by running kyua without any arguments.

It looks like our fix is no longer needed now, so revert it to reduce
diffs against upstream.

PR: 253226
Reviewed by: arichardson, kp
Differential Revision: https://reviews.freebsd.org/D28799

(cherry picked from commit d2b3fadf2db56131376a71b0597876b591a6aee4)

Git Hash: 0aa8c6552ff58a8945a62750771b3f582f938d08
Git Author: dim@FreeBSD.org


# 369326 20-Feb-2021 dim

Revert "Revert 3c4fd2463bb2 since upstream libcxxrt fixed it in another way"

This reverts commit 49e7d3fee6ac52d1c65160a71b1f2be70e43c5e1, since I
messed up and didn't merge the earlier libcxxrt changes first.

Git Hash: 9418450e056f8a75c0e5d0b1197d94745da0c18d
Git Author: dim@FreeBSD.org


# 369324 20-Feb-2021 dim

Revert 3c4fd2463bb2 since upstream libcxxrt fixed it in another way

In 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 I imported a more recent
libcxxrt snapshot, which includes an upstream fix for the padding of
struct _Unwind_Exception:

https://github.com/libcxxrt/libcxxrt/commit/e458560b7e22fff59af643dba363544b393bd8db

However, we also had a similar fix in our tree as:
https://cgit.freebsd.org/src/commit/?id=3c4fd2463bb29f65ef1404011fcb31e508cdf2e2

Since having both fixes makes the struct too large again, it leads to
SIGBUSes when throwing exceptions on amd64 (or other LP64 arches). This
is most easily tested by running kyua without any arguments.

It looks like our fix is no longer needed now, so revert it to reduce
diffs against upstream.

PR: 253226
Reviewed by: arichardson, kp
Differential Revision: https://reviews.freebsd.org/D28799

(cherry picked from commit d2b3fadf2db56131376a71b0597876b591a6aee4)

Git Hash: 49e7d3fee6ac52d1c65160a71b1f2be70e43c5e1
Git Author: dim@FreeBSD.org


# 350400 29-Jul-2019 dim

MFC r350360:

Merge libcxxrt master f96846efbfd508f66d91fcbbef5dd808947c7f6d.

Interesting fixes:
f96846e Fix std::size_t -> size_t to unbreak build against libc++ 6.0.0
6f4cfa2 Fix the uncaught exception count with rethrowing (PR 239265)
db54f53 Added C++14-specific operator delete (#47)

PR: 239265


# 303292 25-Jul-2016 emaste

MFC r303157: libcxxrt: add padding in __cxa_allocate_* to fix alignment

The addition of the referenceCount to __cxa_allocate_exception put the
unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte
alignment. In order to avoid changing the current __cxa_exception ABI
(and thus breaking its consumers), add explicit padding in the
allocation routines (and account for it when freeing).

This is intended as a lower-risk change for FreeBSD 11. A "more correct"
fix should be prepared for upstream and -CURRENT.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation