DXGI interfaces are released before their last use in Generic::getVendorId
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 86/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- operating-systems
Direzione di ricerca
Inizia in source/platforms/sl.chi/generic.cpp, in Generic::getVendorId, intorno alle righe 349-367, e analizza la convenzione WRL ComPtr esistente. Mantieni la ownership delle interfacce DXGI acquisite fino ai loro utilizzi finali, preservando i controlli HRESULT e il comportamento in caso di errore. Valida con il focused lifetime harness oppure compilando la translation unit modificata con MSVC.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Generic::getVendorId releases both acquired COM interfaces before using them:
IDXGIDevice* dxgiDevice{};
if (SUCCEEDED(((IUnknown*)m_typelessDevice)->QueryInterface(&dxgiDevice)))
{
dxgiDevice->Release();
IDXGIAdapter* adapter{};
if (SUCCEEDED(dxgiDevice->GetAdapter(&adapter)))
{
adapter->Release();
DXGI_ADAPTER_DESC desc;
if (SUCCEEDED(adapter->GetDesc(&desc)))
Source: generic.cpp at e8aaa6e. The same pattern is present on current main.
An outstanding reference to the original device does not guarantee that a separately acquired interface wrapper remains alive. COM permits independently managed tear-off interfaces; the returned pointer must remain owned until its final use. See Microsoft's reference-counting guidance.
This permits use-after-release at dxgiDevice->GetAdapter and independently at adapter->GetDesc, even if conventional native implementations happen to retain those objects internally.
Proposed fix
Keep both acquired references until scope exit using the existing WRL ComPtr convention. This preserves the HRESULT checks, return values, and unchanged output on failure, while releasing each reference on all exits.
A focused fix is available in northaxosky/Streamline commit 2e83322: one file, five insertions and six deletions. I attempted to submit it as a PR, but this repository currently has pull requests disabled.
Validation and limits
The modified translation unit compiled with MSVC. A local source-extracted lifetime harness exercises the success/error paths and independently reference-counted interface test doubles; retaining the interfaces removes its lifetime violations. This is a focused ownership check, not a full COM conformance or SDK integration test.
A full SDK build was not completed in this environment. Investigation began after a RenderDoc-enabled D3D11 application encountered an exception during Streamline device registration, but exact attribution of that application exception to this function has not been established. This report stands on the source-level ownership defect, not a claimed reproduction of that particular crash. No application binaries, captures, or crash dumps are attached.
- Lingua principale
- C
- Stelle
- 1.4k
- Fork
- 174
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 NVIDIA-RTX/Streamline
-
Title: Vulkan: VK_FORMAT_R8_UNORM missing in Vulkan::getFormatForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NVIDIA-RTX/Streamline#133 ·
-
sl.log folder makes it hard to integrate, as many developer has *.log in the exclude filter for git/p4.Forse già presa @Dragon31337 l’ha presa 72 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
NVIDIA-RTX/Streamline#121 ·
-
C++23 issueApertabug triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NVIDIA-RTX/Streamline#111 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
NVIDIA-RTX/Streamline#136 · 1 commento · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
NVIDIA-RTX/Streamline#134 ·
Tutte le issue di NVIDIA-RTX/Streamline
Issue simili
-
ecs_ptr_from_json does not free the buffer of a string longer than 256 bytes on two error pathsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SanderMertens/flecs#2444 ·
I maintainer di solito rispondono entro 1 giorno
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
espressif/esp-eth-drivers#201 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
libsdl-org/SDL#16788 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
cisco/ChezScheme#1110 ·
I maintainer di solito rispondono entro 1 giorno