OSDN Git Service

Make sigchain actually own the signal chain.
authorJosh Gao <jmgao@google.com>
Thu, 16 Mar 2017 00:40:42 +0000 (17:40 -0700)
committerJosh Gao <jmgao@google.com>
Sat, 18 Mar 2017 00:04:31 +0000 (17:04 -0700)
commit7600fa9234e02cf5108a3a82babf3d3ab82fcddd
tree7fc841d365122ae618b657c7bd3fa28e8151e870
parented883a11b8cd7f3712bd30fca1e2b0fb641bff63
Make sigchain actually own the signal chain.

sigchain exists to make sure that art's signal handler is at the front,
but it currently does this by putting the fault manager in the actual
signal handler slot and having that handler call into sigchain when it
doesn't want to handle a signal. sigchain also has a "special signal
handler" (used for native bridge) that runs before user handlers, but
after ART's.

Move maintenance of the signal chain into sigchain itself, and use the
same mechanism to handle the ART handler and the native bridge handler.

Also, clean up some bugs:
  - InvokeUserSignalHandler was using the wrapper sigprocmask instead
    of the actual one.
  - Use SIG_SETMASK instead of SIG_BLOCK between calling handlers, in
    case one of the handlers changes the signal mask.
  - Correctly handle sigaction without SA_SIGINFO.

Bug: http://b/36205469
Bug: http://b/36262089
Test: NPE with dalvikvm with/without TEST_NESTED_SIGNAL defined (arm/aarch64)
Change-Id: I416b13de800d3e23424cf20688ccfd7e4e48a111
runtime/fault_handler.cc
runtime/fault_handler.h
runtime/java_vm_ext.cc
runtime/native_bridge_art_interface.cc
sigchainlib/sigchain.cc
sigchainlib/sigchain.h
sigchainlib/sigchain_dummy.cc
sigchainlib/version-script32.txt
sigchainlib/version-script64.txt
test/004-SignalTest/expected.txt
test/004-SignalTest/signaltest.cc