[libcxx-commits] [PATCH] D128998: [libunwind] Handle G in personality string

Florian Mayer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 4 19:32:23 PDT 2022


fmayer created this revision.
Herald added projects: libunwind, All.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libunwind.
fmayer updated this revision to Diff 441774.
fmayer added a comment.
fmayer updated this revision to Diff 441775.
fmayer updated this revision to Diff 441789.
fmayer updated this revision to Diff 441791.
fmayer updated this revision to Diff 441811.
fmayer updated this revision to Diff 441825.
fmayer updated this revision to Diff 441826.
fmayer updated this revision to Diff 449466.
fmayer published this revision for review.
fmayer added a reviewer: eugenis.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

fix unused argument error


fmayer added a comment.

format


fmayer added a comment.

fix mingw build


fmayer added a comment.

build


fmayer added a comment.

clang fmt


fmayer added a comment.

fix build


fmayer added a comment.

comment


fmayer added a comment.

update comment


fmayer added a comment.

In addition to the test described in the message, I ran the libunwind test suites on FVP with SANITIZE_TARGET=memtag-stack and they still pass.


Tested with the following program:

  static volatile int* x = nullptr;
  
  void throws()  __attribute__((noinline)) {
    if (getpid() == 0)
      return;
    throw "error";
  }
  
  void maybe_throws()  __attribute__((noinline)) {
    volatile int y = 1;
    x = &y;
    throws();
    y = 2;
  }
  
  int main(int argc, char** argv) {
    int y;
    try {
      maybe_throws();
    } catch (const char* e) {
      //printf("Caught\n");
    }
    y = *x;
    printf("%d\n", y); // should be MTE failure.
    return 0;
  }

Without this change, we crash on cxa_get_globals when trying to catch
the exception (because the stack frame hadn't been cleared up). With
this change, we crash on the `y = *x;` as expected, because the stack
frame has been untagged, but the pointer hasn't.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128998

Files:
  libunwind/src/DwarfInstructions.hpp
  libunwind/src/DwarfParser.hpp
  libunwind/src/UnwindCursor.hpp
  libunwind/src/UnwindLevel1.c
  libunwind/src/libunwind.cpp
  libunwind/src/libunwind_ext.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128998.449466.patch
Type: text/x-patch
Size: 10157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220805/0b025bc4/attachment.bin>


More information about the libcxx-commits mailing list