[PR #2315] [MERGED] runtime: own the executable TLS exit callback #2319

Closed
opened 2026-11-26 21:20:49 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2315
Author: @ZroIsHere
Created: 11/26/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142

Base: main ← Head: fix/thread-local-exe-atexit-callback


📝 Commits (1)

  • 338dc11 runtime: own the executable TLS exit callback

📊 Changes

4 files changed (+48 additions, -6 deletions)

View changed files

📝 runtime/README.md (+5 -3)
📝 runtime/shims/process.cpp (+12 -3)
📝 runtime/shims/process_shim.h (+21 -0)
📝 runtime/src/pe_loader.cpp (+10 -0)

📄 Description

During boot, the executable's _register_thread_local_exe_atexit_callback import reached the host UCRT and terminated the process with FAST_FAIL_FATAL_APP_EXIT before D3D12 initialization.

Bind the callback to the runtime. Run it after the executable's TLS thread-detach callbacks and before normal CRT exit parks the game thread. _Exit, quick_exit, ExitProcess and abort continue to skip CRT cleanup.

Validation: the Windows/MSVC RelWithDebInfo gta6rt build passed. With the Vulkan backend, translated shaders and a scripted GameInput pad for the no-SDL build, the retail package rendered non-black 3840×2160 frames and reached the Spanish onboarding UI. Captures are in _build/thread-local-shaderboot9/captures (frame_01501 and frame_02001). No tests were run.


🔄 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/2315 **Author:** [@ZroIsHere](https://github.com/ZroIsHere) **Created:** 11/26/2026 **Status:** ✅ Merged **Merged:** 11/26/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `fix/thread-local-exe-atexit-callback` --- ### 📝 Commits (1) - [`338dc11`](https://github.com/ubiquitarianism/leonida/commit/338dc11ea622cb3ab0406cafd9af3f08a3740e50) runtime: own the executable TLS exit callback ### 📊 Changes **4 files changed** (+48 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `runtime/README.md` (+5 -3) 📝 `runtime/shims/process.cpp` (+12 -3) 📝 `runtime/shims/process_shim.h` (+21 -0) 📝 `runtime/src/pe_loader.cpp` (+10 -0) </details> ### 📄 Description During boot, the executable's `_register_thread_local_exe_atexit_callback` import reached the host UCRT and terminated the process with `FAST_FAIL_FATAL_APP_EXIT` before D3D12 initialization. Bind the callback to the runtime. Run it after the executable's TLS thread-detach callbacks and before normal CRT exit parks the game thread. `_Exit`, `quick_exit`, `ExitProcess` and `abort` continue to skip CRT cleanup. Validation: the Windows/MSVC RelWithDebInfo `gta6rt` build passed. With the Vulkan backend, translated shaders and a scripted GameInput pad for the no-SDL build, the retail package rendered non-black 3840×2160 frames and reached the Spanish onboarding UI. Captures are in `_build/thread-local-shaderboot9/captures` (`frame_01501` and `frame_02001`). No tests were run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:49 +01:00
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#2319
No description provided.