audio: log the XDspActivate parameter block before refusing #3478
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3478
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3476"
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?
@Leyukaka on GitHub · 2026-11-29 16:37 UTC · original
Leyukaka:runtime-xdsp-activate-log→main· +58 −2 · 2 files · 2 commits · merged 2026-11-30 19:58 UTCRefs #1145
What changes
XDspActivate(src/startup_stubs/chad.cpp) logs the activation parameter block (second argument) for its first 6 calls, before the existing refusal:x2w-audio XDspActivate rdx=0x... params=<128 hex digits>: 64 bytes at the parameter pointer. They are copied to a local buffer withguarded_memcpyafterprobe_readablereports all 64 bytes readable, and the hex is built from that copy.x2w-audio XDspActivate rdx=0x... params=unreadablewhen the probe or the copy fails (null, reserved or unmapped pointer).The block has its own call counter and never returns early. Return value and outputs are unchanged: the refusal from #1887 stays (
E_POINTERon a null or unwritable output, otherwise both outputs cleared andXDSP_E_NO_DEVICE_RESOURCES).Why
#1145: the run log shows that activations are refused, but not what was requested. The stand-in logs the argument values and the two output pointers, not the contents of the parameter block, so a run on
maindoes not show which effects the application asks for.Tests
tests/startup_chad_check.cpp:0xc0..0xff) must appear as one complete 128-digit log line.MEM_RESERVE/PAGE_NOACCESSpage and a null pointer must each logparams=unreadable.XDSP_E_NO_DEVICE_RESOURCESwith both outputs cleared.E_POINTERchecks are kept. The one with unwritable outputs now runs after the three calls above.Build with libopus off, on
9798063c:Result: 1/1 passed.
Mutations, each restored afterwards:
std::memcpyfrom the pointerFAIL: XDspActivate logs all 64 sentinel parameter bytesNot covered
@lukaslw-lab on GitHub · 2026-11-30 08:38 UTC · original · approved these changes
Reviewed
9798063cby reading the diff; not built or run.Verdict: approve. Diagnostic only. The read is bounded and guarded, and the refusal path is unchanged. No MUST.
probe_readablerefuses addresses below 0x10000 and unmapped space without touching them (local_log.h:137,:141).guarded_memcpy(..., false)then catches an access violation on a page that goes away after the probe, and the copy goes into a zeroed local buffer. The dump has its ownfirst_calls(param_logs, 6)counter, so the existingacceptlogging and its limit are untouched.params=unreadable, although its first bytes could be read.probe_readablealready returns the readable length, so the line could dump that prefix with its length. That only matters if the real block turns out to be shorter than 64 bytes and lies at a page end.Tests:
startup_chad_checksetsX2W_TRAP_LOGto its own temp file (startup_chad_check.cpp:136), so the new log assertions run under ctest. They cover the full 128-digit line,unreadablefor a reserved page and for null, and the unchanged results. The two crash mutations show the guard and the probe are each needed. CI builtchad.dllbut did not runstartup_chad_check: it is not in theprpreset's list, and/O2was skipped on the PR.