SIGSEGV in Wine's syscall dispatcher: vkback's live guards make Wine thread stacks at 0x1_0000_0000 read-only #139
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/vktory6--VKtory#139
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@firefloc on GitHub · 2026-12-01 20:54 UTC · original
Seen on:
5930321(main), plus local fork commits that touch none ofcrates/victory-gpu/src/watch*, vkback's texture watch/refresh/fill, victory-hlexmem/umemorgreenfield/umem.Machine: RX 7900 XTX (RADV, Mesa 26.3.1), Ryzen 7 7800X3D, GE-Proton 11-14, Series X mode,
VICTORY_VIEW_GUARD=0.Symptom
The whole process dies with SIGSEGV a few minutes into the world (seen from the cell save and from a blank save), with no PE-side context in the log. Reproduced on three cores with the same signature:
SEGV_ACCERRat0x1_001f_e3f0inntdll.so!__wine_syscall_dispatcher+9(pop 0x70(%rcx), writing the syscall frame), called fromWaitOnAddress->RtlWaitOnAddress->NtWaitForAlertByThreadId; the thread's TLS (fs_base) is0x1_001f_f6c0;segv_handlerthen dies withSI_KERNEL, which is what ends the process;[0x1_0000_0000, 0x1_0020_0000)is anonymous and read-only.Cause (captured)
[0x1_0000_0000, 0x1_0020_0000)holds two Wine thread stacks of 1 MiB: the main thread's (__wine_main->virtual_alloc_thread_stack) and oneNtCreateThreadExmakes at process start. The faulting thread owns the upper one. This is also where xmem'saddress_rangestarts the title window (1 << 32); the first umem mapping sits 2 MiB above it.A GDB probe on
mprotect/pkey_mprotect/mmap/munmap/mremapover that range caught 32 callsmprotect(block, 0x10000, PROT_READ), one per 64 KiB block from0x1_0000_0000to0x1_001f_0000, coming fromNtProtectVirtualMemorycalled by kernelbase'sVirtualProtecton two PE threads./proc/<pid>/mapsshowed both stacks turnr--pin the same second, and the process died right after the last block, the one holding the syscall frame and the TLS.That is the shape of
watch::live::live_protect: vkback asks to guard every texture filled from title memory (watch_texture->OP_LIVE_GUARDS->live_guard), including textures whose memory umem does not back, and the title names a texture at0x1_0000_0000(the same run logsbuffer view over memory umem does not back (CPU memory, null): SRV 0x100000000).live_protecttries the whole run of blocks in oneVirtualProtect, which Wine refuses across the two stacks' views. Its block-by-block retry then makes every block read-only without asking what lies there.guardasksis_viewfirst; the live path never does.Fix
PR #141:
live_protectguards only the blocksis_viewaccepts, asguarddoes; the others stay writable, are counted and the first 16 are logged. With it, the same scenario from a blank save passes the point: the refusals are logged from0x1_0000_0000on, both stacks stayrw-p, and there is no core.The underlying overlap (Wine's stacks inside the title window, and the title naming addresses there) is a separate finding: #140.
@vktory6 on GitHub · 2026-12-01 21:05 UTC · original
Thanks for the thorough capture. The diagnosis matches the code:
guardasksis_view, the live path did not. PR #141 is in our checks now (build and tests pass; the validation run is queued). I'll close this when it merges. The underlying overlap is tracked as a task from #140.@vktory6 on GitHub · 2026-12-01 21:15 UTC · original
Fixed by #141, merged as
github.com/vktory6/VKtory@77a61b9. The title window overlap stays open in #140 and its task. Closing.github-bot referenced this issue2026-12-02 12:34:29 +00:00