Loader: a trapped unimplemented import goes into the crash log #245
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!245
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/245/head"
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?
@Dufftwt on GitHub · 2026-11-24 01:45 UTC · original
Dufftwt:fix/import-trap-in-crash-log→main· +42 −4 · 1 files · 1 commits · merged 2026-11-24 07:58 UTCWhat's wrong
When the title calls an import that nothing implements, the default
--unimplemented trappolicy:tracing;VIctory: unimplemented import <dll>!<symbol> called;std::process::abort().On Windows,
abort()is a fast fail (__fastfail). It ends the process without running the vectored handler, the unhandled-exception filter or the panic hook, and those are the only things that append tocrashes.log. So this crash, the most common one during bring-up, leaves nothing incrashes.log: not the import's name, and not the title's last debug lines that every other crash report carries. The README says every crash is appended there, and once the console window is gone, the log is all a reporter has.What the fix does
The trap now reports through
log_crash(incrash.rs), the function GPU failures already use, instead of a bareeprintln!.log_crash:VIctory: unimplemented import <dll>!<symbol> calledline to the console, as before;crashes.log;The debugger break and the
abort()are unchanged.How it behaves after the fix
A title that calls a missing import still stops at once, with the same console line.
crashes.lognow also has an entry,VIctory: unimplemented import probe.dll!Missing called, followed by the title's last lines. A pasted log then says which API needs implementing.Tests
a_trapped_import_is_in_the_crash_logreruns the test binary as a child process, using the same pattern asthreads::tests::exit_ends_the_other_threads_first. The child sets up a crash log in a temp folder and calls a trapping stub forprobe.dll!Missing. The parent then checks two things: the child failed, and the log names the import.I ran
cargo test --workspaceon GitHub'swindows-latestwith Rust 1.98.1 fromrust-toolchain.toml:victory-loaderhas 20 passed, the other crates have 0 failed.main: it fails because the crash log is empty (crash log: ""). The child aborted without writing it.--test-threads=1. With 4 threads, the shader crate's GPU tests sometimes crash on that runner (STATUS_ACCESS_VIOLATION), on unmodifiedmainas well.Not tested: a real title hitting a missing import.
@jeremygold02 on GitHub · 2026-11-24 05:06 UTC · original
Thanks @Dufftwt for logging the trapped import before aborting. I tested the open PR at head
5f670bbfdba199a7537124adaa7ef5b0871e352bwith:Result: 1 passed, 0 failed (19 filtered out). The controlled child-process test triggers an unimplemented import trap and verifies the import name appears in the crash log before the process aborts. This tests the crash-report path with a synthetic child process; no title or game log was used.
Code: thunks.rs.