OSDN Git Service

Catch signals that happen inside a fault handler.
authorJosh Gao <jmgao@google.com>
Wed, 1 Mar 2017 00:53:59 +0000 (16:53 -0800)
committerJosh Gao <jmgao@google.com>
Wed, 8 Mar 2017 23:07:49 +0000 (15:07 -0800)
commitefd20cb2f63cf647c7d947d00e8987affefeb177
tree666ea53832f1085378bcc75620f314ba1f46a330
parentcaa348cee1312150a957bd308ce77ad406f3eb64
Catch signals that happen inside a fault handler.

Unblock some signals (SIGABRT, SIGBUS, SIGSEGV) that could happen
inside of the ART internal fault handlers, to report crashes inside of
the signal handler. Because we can't use sigaction to change the
handler when this happens, because it modifies global state, add a new
member variable in Thread to track whether a call to the fault handler
is reentrant or not.

Remove the old nested signal implementation that attempted to do this.

Bug: http://b/35853436
Test: changed the #if 0 to #if 1, ran a dummy process that
      threw a NullPointerException, inspected logcat
Change-Id: I04bb4a09433c6817933d64ec681ec433b528f2a5
13 files changed:
runtime/arch/arm/fault_handler_arm.cc
runtime/arch/arm64/fault_handler_arm64.cc
runtime/arch/mips/fault_handler_mips.cc
runtime/arch/mips64/fault_handler_mips64.cc
runtime/arch/x86/fault_handler_x86.cc
runtime/arch/x86/quick_entrypoints_x86.S
runtime/arch/x86_64/quick_entrypoints_x86_64.S
runtime/entrypoints/quick/quick_throw_entrypoints.cc
runtime/entrypoints_order_test.cc
runtime/fault_handler.cc
runtime/fault_handler.h
runtime/thread.cc
runtime/thread.h