Skip to content

Terminate the TTD target on the engine thread - #1182

Open
xusheng6 wants to merge 1 commit into
devfrom
test_1129_ttd_quit_thread
Open

Terminate the TTD target on the engine thread#1182
xusheng6 wants to merge 1 commit into
devfrom
test_1129_ttd_quit_thread

Conversation

@xusheng6

Copy link
Copy Markdown
Member

DbgEng clients are thread-affine, and ExitDispatch() is the only call documented as safe from another thread. Quit() was calling TerminateCurrentProcess() from the requesting thread while the engine thread sat in DispatchCallbacks(), which faults inside WinDbg 1.2606's new V8-based JSProvider.dll.

Quit() now only raises m_terminateRequested and wakes the engine loop, which performs the terminate itself.

Reproduced with a harness mirroring the adapter (callbacks, worker thread, engine loop): 5/5 crashes before, 0/10 after on 1.2606, and 0/3 on 1.2603. WinDbg 1.2402 and 1.2603 never crashed either way, so the pinned version was already a valid mitigation.

Untested path: if the trace is replaying rather than sitting at a break, Quit() falls back to SetInterrupt(); the harness always stopped at a break.

Fixes #1129

🤖 Generated with Claude Code

DbgEng clients are thread-affine, and ExitDispatch() is the only call
documented as safe from another thread. Quit() was calling
TerminateCurrentProcess() from the requesting thread while the engine
thread sat in DispatchCallbacks(), which faults inside WinDbg 1.2606's
new V8-based JSProvider.dll.

Quit() now only raises m_terminateRequested and wakes the engine loop,
which performs the terminate itself.

Reproduced with a harness mirroring the adapter: 5/5 crashes before,
0/10 after on 1.2606, and 0/3 on 1.2603. WinDbg 1.2402 and 1.2603 never
crashed either way.

Fixes #1129

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@xusheng6
xusheng6 requested a review from plafosse August 14, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DbgEng TTD adapter crashes on stopping debugging when using latest WinDbg

1 participant