[PATCH] D48509: Improve crash unwinding on Fuchsia
Aaron Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 22 16:54:06 PDT 2018
aarongreen created this revision.
aarongreen added reviewers: kcc, mcgrathr, phosek.
Herald added subscribers: Sanitizers, llvm-commits, chrib.
Herald added a reviewer: jfb.
Fuchsia doesn't have signals; instead it expects processes to have a dedicated exception thread that binds to the process' exception port and waits for exception packets to be delivered. On the other hand, libFuzzer and sanitizer_common use expect to collect crash information via libunwind from the same thread that caused the exception.
The long term fix is to improve support for remote unwinding in libunbwind, plumb this through sanitizer_common and libFuzzer, and handle the exception exclusively on the exception thread. In the meantime, this revision has the exception thread "resurrect" the crashing thread by:
- saving its general purpose register state onto the crashing thread's stack,
- setting the crashing thread's program counter to an assembly trampoline with the CFI information needed by libunwind, and
- resuming the crashed thread.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D48509
Files:
lib/fuzzer/FuzzerUtilFuchsia.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48509.152556.patch
Type: text/x-patch
Size: 12738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180622/2a27fcc0/attachment.bin>
More information about the llvm-commits
mailing list