Wine's first thread stacks lie at the start of the title window (0x1_0000_0000), and the title names addresses there #140
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#140
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 do not touch xmem, umem or the thread setup.Machine: RX 7900 XTX (RADV), GE-Proton 11-14.
Found while fixing #139. Wine places its first two thread stacks (1 MiB each, the main thread's from
__wine_mainand one fromNtCreateThreadExat process start) at[0x1_0000_0000, 0x1_0020_0000). That is where victory-hlexmem::address_rangestarts the title window (1 << 32). The title's first umem mapping lands 2 MiB higher, at0x1_0020_0000.The title still names addresses in that range: vkback logs
buffer view over memory umem does not back (CPU memory, null): SRV 0x100000000 len 320, and a texture filled from title memory starts at0x1_0000_0000(vkback then asked to guard it, which caused #139). Either way, it reads a Wine stack as title data.Open questions:
@vktory6 on GitHub · 2026-12-01 21:05 UTC · original
Thanks, a clear find. I created a task based on your report:
github.com/vktory6/VKtory@db860f6("Wine's first thread stacks lie inside the title window"). The goal there: no Wine or host allocation in the title window, and a title address that is neither umem's nor a view's becomes a counted, loud error wherever it is read. Your three open questions are in it. Leaving this issue open until the window is reserved.@TheRifai on GitHub · 2026-12-02 10:32 UTC · original
Additional data from the reference-card backend (seen on main
d59b4f8, RX 9070 XT / RADV 26.3.1, GE-Proton11-16, Series X, 4K, 80 s warm-store runs from three saves):buffer view over memory umem does not back (CPU memory, null)hits0x100000000a block asked to be guarded is no title memorylines withblock=0x100000city70boatsave-profilert3(house)So the exact address from the report (
0x100000000, inside the first Wine stack region) is also the dominant source of these null CPU-memory views on this card, and the guard path asks about the same bottom block 16 times per run. This is counted/left-writable behaviour, not a crash here, but it confirms the window overlap is not specific to the RX 7900 XTX or GE-Proton 11-14.Logs:
/home/shlong/Documents/VKtory-capture/perf-{city70,boatsave-profile,rt3}/20261202-*/. I have not tried reserving the window before Wine's first threads; that needs a loader change and is owned by the TASKS item.@firefloc on GitHub · 2026-12-02 17:30 UTC · original
I checked
mainat9388397:XMemVirtualAllocstill chooses addresses starting at0x1_0000_0000when the title requests an allocation. In a separate no-title probe on system Wine 11.23, a PE TLS callback andmainalready observed the same initial thread stack. The first 2 MiB of the title window were free in this probe. Reserving them frommainsucceeded, and a subsequently created thread's stack was outside them. This establishes ordering for the initial stack on this Wine version, without reproducing the GE-Proton stack overlap.To guarantee ownership, look for a Wine startup or loader reservation before initial Windows stack placement, then verify under GE-Proton that Wine leaves the range alone and that VKtory can still split, replace, and release title placeholders without exposing gaps for host allocations. Keep the #141 foreign-stack guard check while adding that startup coverage.
@vktory6 on GitHub · 2026-12-02 18:38 UTC · original
Thanks to both of you. Both findings are in "Wine's first thread stacks lie inside the title window":
github.com/vktory6/VKtory@a58cd901dd0x100000000make up most of that kind in every save (111/111, 542/583, 708/708), and the guards ask about the bottom block 16 times a run. So it isn't specific to the RX 7900 XTX or GE-Proton 11-14.mainis too late for the initial stack. The reservation has to happen in Wine's start-up before the first stack is placed. One lead to check is in the task: Wine's preloader reserves a range given inWINEPRELOADRESERVEbefore ntdll loads. Open questions there: whether GE-Proton honours it and keeps its own allocations out, and whether umem can still split, replace and release title placeholders inside it without gaps. Your point about keeping the #141 guard check is in there too.Leaving this open until the window is reserved.
@vktory6 on GitHub · 2026-12-02 19:33 UTC · original
Related discussion, for anyone following this: https://github.com/vktory6/VKtory/discussions/264 ("Our own runtime vs Wine") covers thread stacks, address-space placement and the other places where Wine/Proton behaviour matters here.