[File Locksmith] Fix Interop access-violation crashes from TerminateThread hang recovery - #49502
Draft
Ryan Johnson (AMDphreak) wants to merge 1 commit into
Draft
Conversation
Killing the NtQueryObject worker with TerminateThread corrupts CRT/heap state and leads to c0000005 crashes in FileLocksmithLib.Interop.dll (microsoft#45158, microsoft#47200). Skip access masks known to hang instead, and guard null UNICODE_STRING / OpenProcess failures. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Dave Rayment (daverayment)
marked this pull request as draft
July 28, 2026 00:19
Collaborator
|
Converted this to draft, as it's AI-developed and there is no proof given that this solves the underlying issue. Ryan Johnson (@AMDphreak) Please fill in the PR details correctly, read the contributor guidelines and refer us to the issue where a maintainer agreed with your approach and approved your work on this. You also seem to have forgotten to include your test results. Many thanks. |
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.
Summary
TerminateThreadwatchdog inNtdllExtensions::handles(). Killing a thread mid-NtQueryObject/ CRT heap use causes later0xc0000005crashes inPowerToys.FileLocksmithLib.Interop.dll(WER offsets map to the worker lambda /memcpy).NtQueryObject/GetFileType(including the previously commented0x0012019ffilter).UNICODE_STRINGbuffers andOpenProcessinpid_to_full_path.Fixes / relates to: #45158, #47200
This is distinct from the already-merged icon crash fix in #48719 (
0xc000027b).Test plan
FileLocksmithLibInterop/ File Locksmith UI (x64 Release)Application Error/c0000005forPowerToys.FileLocksmithUI.exein Event ViewerMade with Cursor