Repository navigation
Diagnostics: the hang watch names the event or semaphore each blocked thread waits on - #31
Merged
Conversation
… thread waits on A retail game's 30 s watchdog fired with its main thread polling an event that a worker never set, the worker blocked in an infinite wait on another object and the pool threads asleep on their semaphores: the stacks showed who waits, not on what nor whether anyone still signals it. With --watch-hang the loader keeps shims on the game's CreateEventW/A, CreateSemaphoreExW, SetEvent, ReleaseSemaphore, CloseHandle and WaitForSingleObject(Ex) (WaitObjectShims, removed otherwise, so a normal run calls kernel32 directly). WaitObjects records each object's kind, creating thread, time and game frames, its signals and the thread that gave the last, and each thread's wait in progress. The hang dump lists every thread blocked a second or more with the handle, the timeout, the object's creation and its last signal or "never signaled". Tests: a thread blocked on a never-set event is reported with its event and creator; once set, the signal is recorded and the wait is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
great diagnostic, merged. danik's intro path sits on the story load until the watchdog with the loader idle, so knowing which event nobody ever sets is exactly what we need there. |
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.
A retail game's 30 s watchdog fired in this state:
The stacks showed who was waiting, but not which object, nor whether anything still signals it.
With
--watch-hang, the loader now keeps shims on the game'sCreateEventW/A,CreateSemaphoreExW,SetEvent,ReleaseSemaphore,CloseHandleandWaitForSingleObject(Ex)(WaitObjectShims). Without the flag they are removed, so a normal run still calls kernel32 directly.WaitObjectsrecords, for each object:It also records each thread's wait in progress. The hang dump lists every thread blocked for a second or more, with the handle, the timeout, how the object was created, and its last signal or "never signaled".
Tests:
Docs:
debugging.md(Hang watchdog) and the--watch-hangrow inloader.md.🤖 Generated with Claude Code