Repository navigation
Hang watch: each game event and semaphore keeps its last operations - #47
Conversation
|
this is really useful, the "signaled 0.2 s before the wait" story is exactly what the old report couldn't show. couple of things before merging though: Signaled and Done now call Caller(), which does the full 64 KB / 6-frame scan on every SetEvent/ReleaseSemaphore/ResetEvent and every wake, just to keep the first address. with the hang watch on, that adds work to exactly the paths whose timing we're watching. could you scan for 1 frame there (or reuse the frames the wait already found)? DoneOnSeveral drops timeouts and abandoned results, so a multi-wait that times out leaves nothing, while single waits record "timed out". the blocked line only names handles[0] for a multi wait, maybe say "one of N". off-mode is fine, since the shims get removed without --watch-hang. heads up too: main got a fix in ReturnAddresses.Scan last night (it only reads the call bytes when their page is committed, 98d9727). it crashed a boot from inside the wait shim, so more Caller() calls go through that path now |
A game run reached the opening cutscene, then hit the game's 30 s watchdog: the main thread waited on a semaphore a worker no longer released, that worker waited on an auto-reset "idle" event of a second worker, and the second waited on a wake event only the first sets. The idle event had been signaled 0.2 s before the first worker started to wait on it, so the signal was taken or dropped in between, but the report only kept the last signal and the shims saw neither ResetEvent nor WaitForMultipleObjects, both of which the game imports. Each object now keeps its last 12 operations (signaled, reset, wait, woke, timed out, or a multi-object wait), with the thread, the time and the game's calling address, and the blocked-wait report lists them. ResetEvent and WaitForMultipleObjects get pass-through shims under --watch-hang like the other wait-object calls. Test: a signal, a multi-object wait that it ends, a reset and a blocked wait are listed in order with their threads; the wake-up that follows is recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…names all of them Review of ThatRecompDev#47: - Signals, resets and wake-ups scan the stack for one game frame only (they run on the paths the hang watch times). - A wait on several objects that times out, fails or ends on an abandoned mutex records that on its objects (the abandoned one, or all), and a wait on all of them records the wake-up on each. - The blocked line of a wait on several names them all: one of N (or all of N) handles, the first described. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5a1cea7 to
6009163
Compare
|
Thanks, done (rebased on main, so it goes through 98d9727's
New test |
|
In game: this history is what found the watchdog cause fixed by #49. The run with it showed:
That ruled out a lost wake-up. With #49 on top, runs reach the opening cinematic (loading screens at 30 fps, then the world at 9–14 fps) and last 600 s without the watchdog. |
|
thanks, all three changes are in and they read well. the one-frame scan in Signaled/Done, timeouts and abandoned results recorded for multi-waits, and the "one of N" wording. merged into main (566a88d). i fixed one architecture rule on the way in (the property pattern in Target became a local and a plain null check), so no need to touch it. two small things if you ever come back to it: a signal from a thread with no game frames still scans the full 64 KB, and the WaitForMultipleObjects shim reads the handle array before kernel32 does, so a bad pointer would crash instead of returning WAIT_FAILED. not urgent |
A game run reached the opening cutscene, then hit the game's 30 s watchdog. The wait-object report showed a cycle:
B had signaled the idle event 0.2 s before A started waiting on it. So the signal was either taken by another wait or dropped in between. The report couldn't tell which: it kept only the last signal, and the shims saw neither
ResetEventnorWaitForMultipleObjects, though the game imports both.Change:
ResetEventandWaitForMultipleObjectsget pass-through shims under--watch-hang, like the other wait-object calls. They are removed otherwise.Test: a signal, a multi-object wait that it ends, a reset and a blocked wait are listed in order with their threads, and the wake-up that follows is recorded. Loader tests and architecture rules pass. Docs are in
debugging.md.🤖 Generated with Claude Code