Repository navigation
Linux: fix a crash when a page write waits on another thread (#883) - #885
Merged
Merged
Conversation
… page is armed again (#883) With the guest heap as driver memory (RADV: the Steam Deck), page write tracking is mprotect + SIGSEGV. When two game threads fault on the same page, the second waits while the first opens it. If the second is descheduled meanwhile, the render thread's next query can arm (and protect) the page again before the second thread sees it open. The handler then took the armed page for "not ours" and reported a crash, on a write the game was allowed to make (#883: f_7001077a30 writing per-draw data into a mapped buffer). Now the waiting thread looks again and opens the page itself when it finds it armed. The soft tracking moves into runtime/platform/soft_tracking.h, unchanged otherwise, so tools/test_soft_tracking.c can run it: the #883 sequence step by step, and writer threads with a querying thread for 2 s. Both fail with the old code (the second every run on an 8-core Mac under Rosetta). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
NevesHenry
pushed a commit
to NevesHenry/LASRecomp
that referenced
this pull request
Nov 26, 2026
…peiikai#889) - peiikai#884, peiikai#888: 130 shader variants from the peiikai#883 logs (2049 records). - peiikai#885: Linux soft page write tracking race (peiikai#883 crash), moved to runtime/platform/soft_tracking.h, with tools/test_soft_tracking.c in CI. - peiikai#889: tools/rando/dungeon_gen.py stays deleted on develop; the same 03G notch landing fix is in C++ via peiikai#890. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 #883.
What happened
The crash line (
signal 11 accessing 0x7281e27900, host pc inf_7001077a30) is a game thread writing per-draw data into a mapped buffer (v1.0.1: the store right after the buffer map call atmain+0x1077cc8). The address is inside the guest heap, which on RADV (the Steam Deck) is driver memory, so page write tracking is the soft one: queries protect pages read-only and the first CPU write faults, and the fault handler opens the page again.soft_releasehad a race. When two threads fault on the same page, the second waits while the first opens it. If the second thread is descheduled meanwhile, the render thread's next query can arm (and protect) the page again before the second thread sees it open. The handler then took the armed page for "not ours" and reported a crash, on a write the game was allowed to make. Linux only (the soft tracking is inlinux.c); macOS and Windows use other tracking.Change
soft_release: after waiting for the other thread, look at the page again; if it is armed, open it here.runtime/platform/linux.cintoruntime/platform/soft_tracking.h(unchanged apart from the fix above), so a test can include it.tools/test_soft_tracking.c(run in the Linux x86-64 and aarch64 CI jobs, listed in CONTRIBUTING "Tests"):Testing
-arch x86_64under Rosetta for 4K pages: both cases pass with the fix (5 runs). With the oldsoft_release, case 1 fails, and case 2 alone fails on every run (3 of 3)...._35361667.log(Field, t=1992) has no crash or hang lines, so this change can't be tied to it. Crash in the telephone house #370 was a different crash (an uncaught exception in the game,TelephoneBox01_Ukuku1), unrelated.🤖 Generated with Claude Code