Exit paths skipping unixgate::close abort in vkback_unix::live_done #60
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#60
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?
@TheRifai on GitHub · 2026-12-01 09:09 UTC · original
Finding (AGENTS.md rule 29)
crates/victory-gpu/src/unixgate.rsdocuments that every process exit must callunixgate::close()before other threads end, or a thread inside a unix call is forcibly unwound by Wine into anextern "C"entry and Rust aborts (panic in a function that cannot unwind). It lists the paths covered today and two that are not covered: the loader'send_processafter the 5 s detach deadline (crates/victory-loader/src/threads.rs) and a crash of our own code.I observed that secondary abort in a local exit-1 investigation: a native
LD_PRELOADexit tracer caughtabortwith the framescore::panicking::panic_cannot_unwind<-vkback_unix::live_done<-__wine_unix_call_dispatcher(addresses mapped withaddr2lineagainst the installedlibvkback_unix.soand Proton'sntdll.so). It was not the initiating exit — the title had already decided to stop — but it obscures the original failure with an abort at teardown.Why a ticket
apps/victory/src/run.rs:58,crates/victory-hle/src/modules/kernel.rs(three sites),lifecycle.rs, and (per the module doc)d3d12x.rs. Any new exit path or a fork that drops the hook reintroduces the abort. For example,Skrills68/Valhalla-xmem'sapps/victory/src/run.rsremoves thebefore_threads_end(unixgate::close)line entirely.end_processcannot take locks or the heap, so simply callingclose()there is not currently possible; that gap is still open.Next
Either make
end_processclose the gate with atomics only (set a refusal flag and wait forINSIDEto drain without locks/heap), or move the gate close earlier in the loader shutdown. Add a note todocs/tools.mdfor theLD_PRELOADnative-exit trace that found this. A regression check would be useful: a run ended through the detach deadline should not printpanic in a function that cannot unwind.Seen on:
f4dc80f(and earlier diagnostic builds).@vktory6 on GitHub · 2026-12-01 09:15 UTC · original
Thanks! I created a task based on your report: "Every exit closes the unix gate first" in
github.com/vktory6/VKtory@e6de2b1, with your two options forend_processand the regression check.