Make use of sigchainlib for signal chaining for implicit checks
This adds a preload library that overrides sigaction and sigprocmask
to implement signal chaining. Signal chaining allows us to chain
any signal so that the ART runtime receives it before any signal
handler registered in native code by an application. If the
ART signal handler doesn't want it, it will pass it on to the
user's handler.
ART uses signals for null pointer checks, stack overflow checks and
suspend points.
Also adds an OAT test to test this in isolation.
Change-Id: I9545f9f7343774c091410eb810504d9855fd399f
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 23a49cb..361070c 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -562,9 +562,20 @@
GetInstrumentation()->ForceInterpretOnly();
}
- if (options->explicit_checks_ != (ParsedOptions::kExplicitSuspendCheck |
- ParsedOptions::kExplicitNullCheck |
- ParsedOptions::kExplicitStackOverflowCheck) || kEnableJavaStackTraceHandler) {
+ bool implicit_checks_supported = false;
+ switch (kRuntimeISA) {
+ case kArm:
+ case kThumb2:
+ implicit_checks_supported = true;
+ break;
+ default:
+ break;
+ }
+
+ if (implicit_checks_supported &&
+ (options->explicit_checks_ != (ParsedOptions::kExplicitSuspendCheck |
+ ParsedOptions::kExplicitNullCheck |
+ ParsedOptions::kExplicitStackOverflowCheck) || kEnableJavaStackTraceHandler)) {
fault_manager.Init();
// These need to be in a specific order. The null point check handler must be