[WSLg / D3D12] `ID3D12PipelineState::GetCachedBlob()` and `ID3D12PipelineLibrary::StorePipeline()` crash with "double free or corruption"
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp, linux
- Ambito
- computer-graphics
Direzione di ricerca
The repro is pso_cache_probe.cpp, which calls GetCachedBlob() on a compute pipeline state and then StorePipeline() on a pipeline library created with CreatePipelineLibrary(nullptr, 0, ...). Build it with the g++ line in the issue and run it under gdb or with AddressSanitizer to get a backtrace at the abort. Done means both calls return instead of aborting, or CheckFeatureSupport stops reporting SINGLE_PSO and LIBRARY. The crash is likely in the WSL D3D12 translation layer (libd3d12.so), which may not be in this repository, so confirm where the backtrace lands before changing anything.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Windows Version
Windows 11 25H2, build 26200.9711
WSL Version
WSL 3.0.5.0, kernel 6.18.58.1-1, WSLg 1.0.79
Are you using WSL 1, WSL 2, or WSLC?
- WSL 2
- WSL 1
- WSLC
Kernel Version
6.18.58.1-1
Distro Version
Ubuntu 24.04
Other Software
-
Direct3D (WSL) 1.611.1-81528511 (libd3d12.so/libd3d12core.so dated 2023-10-20), DXCore 10.0.26100.1
-
NVIDIA RTX PRO 500 Blackwell Generation Laptop GPU, driver 32.0.15.9595
-
Ubuntu 24.04, DirectX-Headers from the distribution
Repro Steps
pso_cache_probe.cpp (compute shader: any DXIL compute shader with an
embedded root signature; ours is compiled with
dxc -T cs_6_0 -E cs_main -Fh depthcopy_cs_main.h -Vn g_cs_main):
#include <wsl/winadapter.h>
#include <directx/d3d12.h>
#include <directx/dxcore.h>
#include <dxguids/dxguids.h>
#include <cstdio>
#include <cstring>
#include "depthcopy_cs_main.h" // const unsigned char g_cs_main[]
int main() {
IDXCoreAdapterFactory *f; IDXCoreAdapterList *l; IDXCoreAdapter *ad = nullptr;
const GUID attr[] = {DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS};
DXCoreCreateAdapterFactory(IID_PPV_ARGS(&f));
f->CreateAdapterList(1, attr, IID_PPV_ARGS(&l));
for (uint32_t i = 0; i < l->GetAdapterCount() && !ad; ++i) {
char desc[256] = {}; IDXCoreAdapter *a;
l->GetAdapter(i, IID_PPV_ARGS(&a));
a->GetProperty(DXCoreAdapterProperty::DriverDescription, sizeof(desc), desc);
if (strstr(desc, "NVIDIA")) ad = a;
}
ID3D12Device1 *dev; D3D12CreateDevice(ad, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&dev));
ID3D12RootSignature *rs; dev->CreateRootSignature(0, g_cs_main, sizeof(g_cs_main), IID_PPV_ARGS(&rs));
D3D12_COMPUTE_PIPELINE_STATE_DESC d = {}; d.pRootSignature = rs; d.CS = {g_cs_main, sizeof(g_cs_main)};
ID3D12PipelineState *p; dev->CreateComputePipelineState(&d, IID_PPV_ARGS(&p)); // S_OK
ID3DBlob *blob;
printf("GetCachedBlob...\n"); fflush(stdout);
p->GetCachedBlob(&blob); // aborts: double free or corruption (!prev)
ID3D12PipelineLibrary *lib; dev->CreatePipelineLibrary(nullptr, 0, IID_PPV_ARGS(&lib));
lib->StorePipeline(L"test", p); // also aborts (seen separately)
return 0;
}
g++ -O1 -g $(pkg-config --cflags DirectX-Headers) -o pso_cache_probe pso_cache_probe.cpp \
$(pkg-config --libs DirectX-Headers) -L/usr/lib/wsl/lib -Wl,-rpath,/usr/lib/wsl/lib -ld3d12 -ldxcore
./pso_cache_probe
Expected Behavior
As on Windows with the same GPU and driver: GetCachedBlob() returns a blob that
can be passed back in D3D12_*_PIPELINE_STATE_DESC::CachedPSO, and
StorePipeline() returns S_OK. Alternatively, CheckFeatureSupport should not
report SINGLE_PSO/LIBRARY when they are unsupported.
Actual Behavior
adapter: NVIDIA RTX PRO 500 Blackwell Generation Laptop GPU
CreateDevice: 0x00000000
CreateRootSignature: 0x00000000
CreateComputePipelineState: 0x00000000
GetCachedBlob: ...
double free or corruption (!prev)
Aborted (core dumped)
StorePipeline() on an empty library created with CreatePipelineLibrary(NULL, 0, ...)
aborts the same way (a LoadGraphicsPipeline() miss before it returns
E_INVALIDARG as expected).
Diagnostic Logs
No response
- Lingua principale
- C++
- Stelle
- 34.4k
- Fork
- 1.9k
- Merge medio
- 1g 23h
- PR unite (30g)
- 166
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/WSL
-
feature wsl2
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
microsoft/WSL#42306 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/WSL#42114 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
feature kernel wsl2
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/WSL#41107 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
feature kernel
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/WSL#41054 · 9 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
feature GPU
Difficoltà 1/5 1-3 ore Idoneità per principianti 70/100
microsoft/WSL#13592 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/WSL
Issue simili
-
needs-format
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Niko1221/Strata#6251 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
[Bug]: NP 管理器文件编辑器里删除键无效Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
metasequoiaime/msime#11666 ·
I maintainer di solito rispondono entro 1 giorno
-
DAE2 crashes on call.without.effects with a non ref.func expressionForse già presa @stevenfontanella l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WebAssembly/binaryen#9404 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
CodeZombie/goodluckOS#178 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
CVO-Org/immersive-cigs-rewrite#313 ·
I maintainer di solito rispondono entro 1 giorno