Windows hard freeze with system encryption: all 8 EncryptedIoQueueItem objects exhausted by blocked completion work items (1.26.29)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- c
调研方向
Start with EncryptedIoQueue.c, especially GetPoolBuffer() and MainThreadProc, then trace CompleteIrpWorkItemRoutine() and its completion path against the captured queue state. The report identifies the relevant functions and a dump, but no test or specific fix; first reproduce or inspect the completion-worker behavior, then verify system-disk I/O continues without exhausting the eight queue items.
由索引模型根据 Issue 内容生成。
描述
Expected behavior
Windows should remain responsive while the system partition is encrypted with VeraCrypt, and normal reads/writes to the system NVMe drive should continue to complete without the VeraCrypt encrypted-I/O queue becoming permanently blocked.
Observed behavior
With VeraCrypt 1.26.29 system encryption enabled, Windows occasionally freezes completely. The UI stops responding first, while the mouse cursor may continue moving briefly; after several seconds the cursor also freezes. Ctrl+Alt+Del and keyboard lock keys stop responding, and the machine requires a hard reset unless I trigger a manually initiated crash quickly enough.
The problem appears closely tied to system encryption. After fully decrypting the Windows system partition, the freezes appeared to stop even though VeraCrypt remained installed and veracrypt.sys was still loaded. After reinstalling VeraCrypt 1.26.29 and enabling system encryption again, the freezes returned.
I configured Windows manual crash generation and captured a kernel memory dump while the system was in the frozen state. The resulting bugcheck is therefore intentionally MANUALLY_INITIATED_CRASH (0xE2); the important part is the kernel state captured immediately before the crash.
Using the official VeraCrypt 1.26.29 debugging symbols, the dump shows the following runtime queue configuration:
EncryptionIoRequestCount = 16
EncryptionItemCount = 8
EncryptionMaxWorkItems = 1024
EncryptionFragmentSize = 256 KiB
At the frozen instant, VeraCrypt's MainThreadProc had been waiting for about 42 seconds in GetPoolBuffer() at EncryptedIoQueue.c:185, called from MainThreadProc at line 845. That code is trying to obtain another EncryptedIoQueueItem.
nt!KeWaitForSingleObject
veracrypt!GetPoolBuffer+0x123
veracrypt!MainThreadProc+0xb7
sizeof(veracrypt!EncryptedIoQueueItem) is 0x38. I traversed the queue's FirstPoolBuffer list and found exactly eight buffers of that size, matching EncryptionItemCount = 8, and all eight were marked InUse = 1:
EncryptedIoQueueItem buffers: total=8 inuse=8
The corresponding EncryptedIoQueue object (ffffde8c6900aa70) showed a large I/O backlog while the queue was otherwise active and not suspended:
OutstandingIoCount = 508
IoThreadPendingRequestCount = 0
ActiveWorkItems = 8
MainThreadQueue = non-empty
IoThreadQueue = empty
CompletionThreadQueue = empty
StartPending = 0
ThreadExitRequested = 0
Suspended = 0
SuspendPending = 0
StopPending = 0
The eight active VeraCrypt work items are particularly notable because representative completion workers are blocked while completing IRPs upward through Windows. One example had also been waiting for about 42 seconds:
veracrypt!CompleteIrpWorkItemRoutine
veracrypt!TCCompleteDiskIrp
nt!IofCompleteRequest
FLTMGR!FltpPassThroughCompletion
Wof!FileProvReadCompressedCompletion
Wof!FileProvReadCompressedCompletionWorker
Wof!FileProvReadCompressedOnNewStackExtendedCompletion
Wof!FileProvDecompressChunks
nt!ExAllocateFromPagedLookasideList
nt!ExAllocatePool...
nt!ExfAcquirePushLockExclusiveEx
nt!KeWaitForSingleObject
In VeraCrypt 1.26.29, CompleteIrpWorkItemRoutine() calls TCCompleteDiskIrp() before returning the associated queue item to the pool:
item->Status = workItem->Status;
OnItemCompleted(item, FALSE);
TCCompleteDiskIrp(workItem->Irp, workItem->Status, workItem->Information);
The item is only released later in the finally block: ReleasePoolBuffer(queue, item);
This appears consistent with the captured state: all eight completion work items are active, all eight EncryptedIoQueueItem objects remain occupied, and MainThreadProc is unable to obtain another item. New encrypted I/O therefore stops progressing while the backlog grows.
The dump also contains many threads waiting in Ntfs!NtfsWaitOnIo. Several real NTFS reads and writes are pending at the VeraCrypt device. For example:
IRP_MJ_READ
\Driver\veracrypt
pending
and:
IRP_MJ_WRITE
\Driver\veracrypt
pending
The IRP that MainThreadProc was processing when it became blocked is also an IRP_MJ_READ pending at \Driver\veracrypt.
I did not find a similar concentration of threads blocked in stornvme, and Windows did not log corresponding WHEA, StorPort, StorNVMe, or disk reset/error events. The NVMe device also reports healthy status.
Based on the dump, my current interpretation is that VeraCrypt 1.26.29 can enter a resource-starvation/deadlock condition in the encrypted-I/O completion path. Completion work items become blocked while completing requests through FLTMGR/WOF, retain all available EncryptedIoQueueItem objects, and prevent the main VeraCrypt I/O thread from processing further system-disk requests. I cannot determine from this dump alone whether the initial problem is entirely inside VeraCrypt or is an interaction between VeraCrypt and Windows WOF/memory management.
I also noticed that VeraCrypt has post-1.26.29 commits related to this same area. In particular, the project later reverted the CriticalWorkQueue IRP completion dispatch because Windows instability reports suggested it was a regression risk, and other follow-up changes adjusted completion-work-item handling. This looks potentially related to the state captured in this dump.
I have preserved the approximately 1.3 GB kernel memory dump and the full WinDbg transcript. I would prefer not to attach a kernel dump publicly because it may contain sensitive memory contents, but I can provide it privately to a maintainer if needed.
Steps to reproduce
-
Install VeraCrypt 1.26.29 on Windows and enable system encryption for the Windows system partition.
-
Use Windows normally. In my case, after some time the system eventually becomes completely unresponsive: the UI freezes, then the cursor stops moving, Ctrl+Alt+Del stops working, and a hard reset is normally required.
-
Fully decrypt the Windows system partition and continue using the machine. In my case, the freezes appeared to stop even though VeraCrypt remained installed and
veracrypt.sysremained loaded. -
Re-enable VeraCrypt system encryption. In my case, the hard freezes returned.
The freeze does not appear to require a specific application. I also reproduced a freeze during heavy WinDbg activity, but normal usage has triggered it as well.
Screenshots
N/A
Your Environment
VeraCrypt version: 1.26.29
Operating system and version: Windows 11 x64 (26200)
System type: 64-bit
Boot configuration: UEFI dual boot with Linux Mint/GRUB. VeraCrypt system encryption is applied to the Windows system partition rather than the whole physical disk.
System drive: BIWIN NA80Y1M10-256G NVMe SSD, firmware SN11795
NVMe controller: Microsoft Standard NVM Express Controller
Additional Windows configuration: VBS/HVCI/Hyper-V infrastructure is enabled.
No WHEA errors or corresponding disk, stornvme, or storport errors were found around the freezes. Windows reports the NVMe drive as healthy.
- 主要语言
- C
- 星标
- 11.7k
- 派生
- 1.4k
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 28
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
veracrypt/VeraCrypt 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
bug
难度 5/5 一周以上 新手友好度 32/100
veracrypt/VeraCrypt#1995 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
veracrypt/VeraCrypt#1993 · 2 条评论 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 55/100
veracrypt/VeraCrypt#1991 · 1 条评论 ·
维护者通常 1 天内回复
查看 veracrypt/VeraCrypt 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
bug game: 01008BA02525A000 ios
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
area/ysql kind/bug priority/medium status/awaiting-triage
难度 2/5 1-3 小时 新手友好度 78/100
yugabyte/yugabyte-db#37523 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
ly05010419/MacNativeGames#2079 ·
维护者通常 1 天内回复