[PR #1757] runtime/test: only release output pointer when SUCCEEDED(hr) in pipeline library host test (TEST-PIPELINE-LIBRARY-HOST-RELEASE) #1769

Open
opened 2026-11-26 21:18:53 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1757
Author: @abnalstlll-byte
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: feat/test-pipeline-library-host-release


📝 Commits (2)

  • e761c3a runtime/test: only release output pointer when SUCCEEDED(hr) in pipeline library host test (TEST-PIPELINE-LIBRARY-HOST-RELEASE)
  • 5e4ae90 d3d12, test: preserve hr != kFaulted check on Release and guard test with if(MSVC) (TEST-PIPELINE-LIBRARY-HOST-RELEASE)

📊 Changes

3 files changed (+40 additions, -7 deletions)

View changed files

📝 runtime/CMakeLists.txt (+8 -6)
📝 runtime/test/d3d12_pipeline_library_host_test.cpp (+1 -1)
➕ tests/test_d3d12_pipeline_library_host_release.py (+31 -0)

📄 Description

Claimed in Issue #1608: claiming: TEST-PIPELINE-LIBRARY-HOST-RELEASE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7160887151).

Summary

Resolves the finding by @whoalin1 regarding d3d12_pipeline_library_host crashing with 0xc0000409 (STATUS_STACK_BUFFER_OVERRUN / fail-fast) on RTX 4070 SUPER and AMD gfx1036 (comment 7156997734).

In runtime/test/d3d12_pipeline_library_host_test.cpp:243:
one_step previously executed:

if (written && c.out && hr != HRESULT(kFaulted)) static_cast<IUnknown*>(c.out)->Release();

Calling Release() on an output pointer when FAILED(hr) (e.g. E_NOINTERFACE in step 13 "create: as ID3D12Fence" or E_INVALIDARG) violates COM interface conventions. When a driver or host runtime writes an invalid sentinel or uninitialized pointer on failure, invoking Release() triggers an immediate fail-fast exception (0xc0000409) or access violation that SEH __except (EXCEPTION_EXECUTE_HANDLER) cannot survive.

  • Guard the COM Release() call with SUCCEEDED(hr):
if (SUCCEEDED(hr) && written && c.out) static_cast<IUnknown*>(c.out)->Release();
  • Adds synthetic regression unit test tests/test_d3d12_pipeline_library_host_release.py.

Verification

  • python -I tests/test_d3d12_pipeline_library_host_release.py -> 1/1 PASS in 0.000s.
  • python -I scripts/check_no_game_data.py runtime/test/d3d12_pipeline_library_host_test.cpp tests/test_d3d12_pipeline_library_host_release.py -> Clean (0 violations).
  • 100% clean merge against upstream HEAD bcaa13dad.

AI-assisted (Claude Code).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1757 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/test-pipeline-library-host-release` --- ### 📝 Commits (2) - [`e761c3a`](https://github.com/ubiquitarianism/leonida/commit/e761c3aab0e97d95a2a83788db2ebfbd8c6d5f1b) runtime/test: only release output pointer when SUCCEEDED(hr) in pipeline library host test (TEST-PIPELINE-LIBRARY-HOST-RELEASE) - [`5e4ae90`](https://github.com/ubiquitarianism/leonida/commit/5e4ae90a7bc836d90a8784d1574116d6eb03f5e4) d3d12, test: preserve hr != kFaulted check on Release and guard test with if(MSVC) (TEST-PIPELINE-LIBRARY-HOST-RELEASE) ### 📊 Changes **3 files changed** (+40 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+8 -6) 📝 `runtime/test/d3d12_pipeline_library_host_test.cpp` (+1 -1) ➕ `tests/test_d3d12_pipeline_library_host_release.py` (+31 -0) </details> ### 📄 Description Claimed in Issue #1608: `claiming: TEST-PIPELINE-LIBRARY-HOST-RELEASE` (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7160887151). ### Summary Resolves the finding by @whoalin1 regarding `d3d12_pipeline_library_host` crashing with `0xc0000409` (STATUS_STACK_BUFFER_OVERRUN / fail-fast) on RTX 4070 SUPER and AMD gfx1036 (comment 7156997734). In `runtime/test/d3d12_pipeline_library_host_test.cpp:243`: `one_step` previously executed: ```cpp if (written && c.out && hr != HRESULT(kFaulted)) static_cast<IUnknown*>(c.out)->Release(); ``` Calling `Release()` on an output pointer when `FAILED(hr)` (e.g. `E_NOINTERFACE` in step 13 "create: as ID3D12Fence" or `E_INVALIDARG`) violates COM interface conventions. When a driver or host runtime writes an invalid sentinel or uninitialized pointer on failure, invoking `Release()` triggers an immediate fail-fast exception (`0xc0000409`) or access violation that SEH `__except (EXCEPTION_EXECUTE_HANDLER)` cannot survive. - Guard the COM `Release()` call with `SUCCEEDED(hr)`: ```cpp if (SUCCEEDED(hr) && written && c.out) static_cast<IUnknown*>(c.out)->Release(); ``` - Adds synthetic regression unit test `tests/test_d3d12_pipeline_library_host_release.py`. ### Verification - `python -I tests/test_d3d12_pipeline_library_host_release.py` -> 1/1 PASS in 0.000s. - `python -I scripts/check_no_game_data.py runtime/test/d3d12_pipeline_library_host_test.cpp tests/test_d3d12_pipeline_library_host_release.py` -> Clean (0 violations). - 100% clean merge against upstream HEAD `bcaa13dad`. AI-assisted (Claude Code). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1769
No description provided.