Loader: an allocation the system refuses is written to crashes.log #2074
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2074"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kalberts0089-hash on 2026-11-29T09:08:56Z.
Part of #1956
What it changes
When the allocator returns null, Rust prints "memory allocation of N bytes failed" to the console and fails fast (0xc0000409). No exception handler sees that, so
crashes.logstayed empty and the play log just stopped.The process's allocator is now the system's behind
victory_core::heap::Heap. Before the null goes back, it appends an entry tocrashes.logwith the size and alignment that were asked for, the commit left, the commit limit and the free physical memory. Writing the entry allocates nothing: the text is built on the stack and written through a handle thatlog_crashes_toopens at start. A caller that handles the null itself (try_reserve) gets an entry too. At most 16 entries are written per process.There is one global allocator in every build. Plain builds declare
Heapin victory-gpu, and diagnostics builds keep copystat'sCounting, which now callsHeapinstead ofSystem.docs/windows-memory.mdsays where to find the new entry.How it was tested
Heapdirectly and throughlog_crashes_to. The entry fits its stack buffer when every number is at its largest, and building it allocates nothing.cargo testpassed for the crates it touches: yes (victory-core, victory-loader, victory-gpu with--test-threads=1)cargo build --release -p victorypasses. On current main the diagnostics build fails in code this PR does not touch (mbin copystat,timingin host). With #2048 applied on top, the diagnostics build passes. Clippy shows no new warnings compared with main, in plain or diagnostics builds.Checked for overlap
Counting, so whichever PR lands second needs a small rebase. #730 and #537 also changeCountingor its gating.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.