Repository navigation
Conversation
PageFaultManagerLinux tracks its position in the chain of previous SIGSEGV handlers with a counter shared by all threads. When a second thread faults while another one is still inside a chained handler, it reads before the start of previousPageFaultHandlers and calls a garbage function pointer, or now hits the UNRECOVERABLE_IF. Managed runtimes run into this deterministically: on a GC safepoint every thread faults on the same protected page and waits inside the runtime's handler until all of them have arrived. A handler chain always runs on a single thread, so keep the depth per thread. Related-To: GSD-13581 Signed-off-by: Tim Besard <tim.besard@gmail.com>
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1009.
PageFaultManagerLinuxtracks its position in the chain of previous SIGSEGV handlers withhandlerIndex, a member shared by all threads. When a second thread faults while another one is still inside a chained handler, it computes an index before the start ofpreviousPageFaultHandlersand calls a garbage function pointer (or, since e613839, hits theUNRECOVERABLE_IF). Managed runtimes run into this deterministically: on a GC safepoint every thread faults on the same protected page and waits inside the runtime's handler until all of them have arrived. This crashes multithreaded Julia programs as soon as NEO has installed its handler (JuliaGPU/oneAPI.jl#607).A handler chain always runs on a single thread, so this keeps the depth per thread, the same way
CpuPageFaultManageralready keepshostFunctionActive. The new ULT has two threads fault at once while the previous handler waits for both; it segfaults without the change.Tested: the
PageFaultManagerLinuxTest.*shared ULTs (18/18 pass with the change; the new test crashes without it) on 26.35.39758.10, since master doesn't build in our older-glibc environment. The same change, shipped as a patch in Julia's NEO_jll 26.35.39758+1, fixes the multithreaded GC crash from JuliaGPU/oneAPI.jl#607 on Tiger Lake (with debug keys forcing NEO to install its handler there).