This is an archive of the discontinued LLVM Phabricator instance.

[Unwind] Harmonise exception class for EHABI spec.
ClosedPublic

Authored by danielkiss on Sep 1 2021, 1:01 AM.

Details

Reviewers
manojgupta
MaskRay
ldionne
mclow.lists
Group Reviewers
Restricted Project
Restricted Project
Commits
rGf5b997e6b706: [Unwind] Harmonise exception class for EHABI spec.
Summary

EHABI defines the exception class as char[8] instead of uint64_t [1].
For ABI compatibility the ABI the definition needs to be updated.

[1] https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst#82language-independent-unwinding-types-and-functions

Diff Detail

Event Timeline

danielkiss created this revision.Sep 1 2021, 1:01 AM
danielkiss requested review of this revision.Sep 1 2021, 1:01 AM
danielkiss added a reviewer: Restricted Project.Sep 1 2021, 1:02 AM
manojgupta accepted this revision.Sep 1 2021, 10:23 AM

Thanks Daniel. We still have a problem with pthread_cancel but this resolves the immediate crash.

This revision is now accepted and ready to land.Sep 1 2021, 10:23 AM
MaskRay accepted this revision.Sep 1 2021, 10:29 AM

LGTM.

manojgupta added a subscriber: cjdb.Sep 1 2021, 4:15 PM
This revision was landed with ongoing or failed builds.Sep 2 2021, 2:31 AM
This revision was automatically updated to reflect the committed changes.
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 2 2021, 2:31 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
hans added a subscriber: hans.Sep 2 2021, 9:19 AM
hans added inline comments.
libunwind/src/UnwindLevel1-gcc-ext.c
112

We're seeing a -Wincompatible-pointer-types warning here (which we treat as an error) in Chromium:

../../buildtools/third_party/libunwind/trunk/src/UnwindLevel1-gcc-ext.c:112:10: error: incompatible pointer types passing '_Unwind_Exception_Class *' (aka 'uint8_t (*)[8]') to parameter of type 'char *' [-Werror,-Wincompatible-pointer-types]
  strcpy(&ex.exception_class, "CLNGUNW");
         ^~~~~~~~~~~~~~~~~~~

I see in libunwind/test/forceunwind.pass.cpp you're casting the pointer to char*, maybe that's needed here too?

hans added inline comments.
libunwind/src/UnwindLevel1-gcc-ext.c
112

https://reviews.llvm.org/D109168 fixes it for me locally.

danielkiss added inline comments.Sep 2 2021, 9:51 AM
libunwind/src/UnwindLevel1-gcc-ext.c
112

@hans Thanks for the patch, LGTM.