report apu heap allocations that fail #1720
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!1720
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1720/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?
@imjustprism on GitHub · 2026-11-24 21:17 UTC · original
imjustprism:hle/apu-alloc-refusal-report→main· +112 −20 · 2 files · 1 commits · merged 2026-11-25 21:51 UTCwhen the host allocator refuses an apu heap allocation, ApuAlloc returns E_OUTOFMEMORY and nothing is written anywhere. the title in #289 does not check that result and crashes a moment later on a write near null, so the crash log points at the title instead of at the cause. the refusal now goes to crashes.log with the size and the system commit, the same way the commit-limit report in xmem does, and a request that no device-address range fits gets a warning. both are reported by the caller after its locks are dropped. what the title sees does not change.
checked live: running the title in a job object with a 7.1 GB per-process commit cap reproduces #289, and crashes.log then starts with the refused allocation (about 401 MiB) and the commit numbers. only the report text has a unit test, the host allocator cannot be made to return null in one. clippy both ways, cargo test --workspace (343 passed) and xtask policy on windows 11.
#538 does the same for XMemVirtualAlloc and XMemAllocDefault and touches the same part of xmem.rs, so the two will conflict. #528 and #237 also touch ApuAlloc.
refs #289
github-bot referenced this pull request2026-11-26 05:08:04 +00:00
@Marvisak on GitHub · 2026-11-25 03:35 UTC · original · edited 2026-11-25 07:19 UTC
Automated triage for the maintainers.
Merge candidate. When the host allocator or the device-address range refuses an APU heap block,
heap_alloc(audio.rs) now returns aHeapRefusal, and the callers (ApuAlloc,AcpHalAllocateShapeContexts) report it after dropping their locks. A host refusal goes to crashes.log through the newxmem::report_allocator_refusal, which shares its text with the existing commit-limit report. The HRESULT the title sees does not change. The lock order is fine: the HEAP guard is released on return, and CONTEXTS is dropped beforereport().Update after your reply: confirmed, the branch now merges cleanly with
main, so the #538 conflict is gone. CI passes.Generated by Claude Code
@imjustprism on GitHub · 2026-11-25 04:14 UTC · original
the description is out of date on one point: #538 is merged and this branch is rebased over it, so the xmem.rs conflict it mentions is gone. it merges clean into main at
940d32fand ci is green.@StExpeditus on GitHub · 2026-11-25 09:30 UTC · original
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
bef186b.cargo test --workspace --locked --no-fail-fast-> 694 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.