Recompiler/DXC: null-pointer UB on empty DXC blobs and leaked dxil.dll handle on failed candidate load #2413
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#2413
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?
@ahmetbagci8 on GitHub · 2026-11-25 18:07 UTC · original
Summary
Two issues in
crates/xcl/src/gpu/recomp/dxc.rs:compile_here, lines 525-536):When
GetErrorBuffer()orGetResult()returns an empty blob (GetBufferSize() == 0), DXC returnsnullptrfromGetBufferPointer(). Passingnullptrtostd::slice::from_raw_partsis UB (and panics in debug builds).dxil.dll/dxcompiler.dllhandles on failed candidate load (load, lines 320-340):If
LoadLibraryWfails fordxcompiler.dllorGetProcAddress(h, "DxcCreateInstance")fails,signer(dxil.dll) andhare never freed withFreeLibrary. Leavingdxil.dllfrom a failed candidate folder loaded causes Windows to reuse that staledxil.dllwhen a later candidate'sdxcompiler.dllloadsdxil.dllby name.Suggested fix
from_raw_partscalls withif ptr.is_null() || len == 0.FreeLibrary(signer)/FreeLibrary(h)on error paths inload().Not tested
082944135cd2b96288470a595861fa608eee08dcwithout a new runtime test.AI use
dxc.rsand drafted this report; the author reviewed it before posting.github-bot referenced this issue2026-11-26 05:34:19 +00:00
github-bot referenced this issue2026-11-26 06:14:26 +00:00