You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sigaction): prevent infinite loop in signal handler chaining (#437)
* fix(sigaction): prevent infinite loop in signal handler chaining
When intercepting sigaction calls from other libraries (e.g., wasmtime),
we were returning our handler as oldact. This caused infinite loops:
profiler -> wasmtime -> profiler -> wasmtime -> ...
Fix: Save original (JVM's) handlers in protectSignalHandlers() BEFORE
installing ours, then return those saved handlers as oldact. Now the
chain is: profiler -> wasmtime -> JVM
Also:
- Add sigaction_interception_ut.cpp test to catch this bug
- Wire gtest to run before Java tests in testdebug
- Remove broken test_tlsPriming.cpp (referenced removed APIs)
- Add getSigactionHook() stub for macOS
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address PR review comments
- Add missing <cstring> include for memset
- Fix comment to match int return type (0 = not handled, non-zero = handled)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: close query-only sigaction loop and fix debug-mode SIGABRT
Extend sigaction interception to cover query-only calls
(sigaction(SIGSEGV/SIGBUS, nullptr, &oldact)): return the saved JVM
handler instead of ours, so callers that store oldact and later chain
to it don't loop back into our handler.
Fix intermittent SIGABRT in debug builds on aarch64 GraalVM: extend
crashProtectionActive() with a VMThread::isExceptionActive() fallback
so the cast_to() assert no longer fires for threads without ProfiledThread
TLS when setjmp crash protection is already active in walkVM.
Add OS::resetSignalHandlersForTesting() to prevent static state from
leaking between sigaction interception unit tests.
Add ASCII flow diagram to sigaction_hook documenting the full handler
chain and interception cases.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments