Recompiler/DXC: null-pointer UB on empty DXC blobs and leaked dxil.dll handle on failed candidate load #2403
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?
Imported from ivall/xcl. Originally posted by ahmetbagci8 on 2026-11-25T18:07:29Z.
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.upstream-sync referenced this issue2026-11-25 19:08:47 +00:00
xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2580xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2580xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2580