diff options
author | 2023-01-12 15:00:47 +0000 | |
---|---|---|
committer | 2023-01-13 14:25:46 +0000 | |
commit | 1f3861de4cacb51eacbb624e377b9dc7d7f96cc1 (patch) | |
tree | af51e662d066540d634f2c3494cccb37ac9c91dd | |
parent | fc1e0760d1923bd038e96110ad2b0743307beabb (diff) |
Init fault manager even if we don't install signal handlers.
A few tests rely on libsigchain intercepting system calls and won't pass
with default libc implementation. We did not observe any test failures
previously, because all supported architectures enable optimizations
that cause signal handlers to be installed.
Bug: none
Test: art/test.py --target -r --64 --interpreter \
004-SignalTest \
305-other-fault-handler
# observe that the tests pass in switch interpreter mode
# (disable optimizations that trigger signal handler installation)
Test: art/test.py --host # ensure the case without libsigchain works
Change-Id: Ie8c1cf3f5add15ccc1225c2147d13b5021ebb25c
-rw-r--r-- | runtime/runtime.cc | 46 | ||||
-rw-r--r-- | test/knownfailures.json | 6 |
2 files changed, 24 insertions, 28 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 84ec7ef710..8c0150e6a7 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1768,34 +1768,36 @@ bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) { break; } - if (HandlesSignalsInCompiledCode()) { + if (!no_sig_chain_) { fault_manager.Init(); - // These need to be in a specific order. The null point check handler must be - // after the suspend check and stack overflow check handlers. - // - // Note: the instances attach themselves to the fault manager and are handled by it. The - // manager will delete the instance on Shutdown(). - if (implicit_suspend_checks_) { - new SuspensionHandler(&fault_manager); - } + if (HandlesSignalsInCompiledCode()) { + // These need to be in a specific order. The null point check handler must be + // after the suspend check and stack overflow check handlers. + // + // Note: the instances attach themselves to the fault manager and are handled by it. The + // manager will delete the instance on Shutdown(). + if (implicit_suspend_checks_) { + new SuspensionHandler(&fault_manager); + } - if (implicit_so_checks_) { - new StackOverflowHandler(&fault_manager); - } + if (implicit_so_checks_) { + new StackOverflowHandler(&fault_manager); + } - if (implicit_null_checks_) { - new NullPointerHandler(&fault_manager); - } + if (implicit_null_checks_) { + new NullPointerHandler(&fault_manager); + } - if (kEnableJavaStackTraceHandler) { - new JavaStackTraceHandler(&fault_manager); - } + if (kEnableJavaStackTraceHandler) { + new JavaStackTraceHandler(&fault_manager); + } - if (interpreter::CanRuntimeUseNterp()) { - // Nterp code can use signal handling just like the compiled managed code. - OatQuickMethodHeader* nterp_header = OatQuickMethodHeader::NterpMethodHeader; - fault_manager.AddGeneratedCodeRange(nterp_header->GetCode(), nterp_header->GetCodeSize()); + if (interpreter::CanRuntimeUseNterp()) { + // Nterp code can use signal handling just like the compiled managed code. + OatQuickMethodHeader* nterp_header = OatQuickMethodHeader::NterpMethodHeader; + fault_manager.AddGeneratedCodeRange(nterp_header->GetCode(), nterp_header->GetCodeSize()); + } } } diff --git a/test/knownfailures.json b/test/knownfailures.json index da318d9b8c..1855429daf 100644 --- a/test/knownfailures.json +++ b/test/knownfailures.json @@ -1549,11 +1549,5 @@ "description": ["Change of behavior when used with JDK 17."], "bug": "b/242985234", "variant": "jvm" - }, - { - "tests" : ["305-other-fault-handler"], - "variant": "interpreter", - "description": ["This test intentionally segfaults, but the fault handler is only", - " installed if implicit checks are supported (not for switch interpreter)."] } ] |