[PR #576] [CLOSED] RT-HANG-DUMP: LEONIDA_HANG_DUMP writes every thread's stack after N seconds #620

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/576
Author: @CLHelper
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: runtime/hang-dump


📝 Commits (1)

  • e6438eb startup_trace: LEONIDA_HANG_DUMP writes every thread's stack after N seconds

📊 Changes

3 files changed (+72 additions, -0 deletions)

View changed files

📝 docs/boot.md (+3 -0)
📝 runtime/README.md (+1 -0)
📝 runtime/shims/startup_trace.h (+68 -0)

📄 Description

Claimed in the coordination issue as: RT-HANG-DUMP (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126610928)

What and why

A retail boot that faults leaves a last exception in the trace; one that hangs leaves nothing to look at. With
LEONIDA_HANG_DUMP=<seconds>, gta6rt waits that long and then writes the stack of every thread in the process to the
startup trace (each thread is suspended briefly while its context is read, then resumed), so a stalled boot shows
where each thread waits. Unset, nothing changes: no thread is started.

The code is in runtime/shims/startup_trace.h; docs/boot.md and runtime/README.md name the variable.

The commit is 4ld0-vito's (from their fork, where it was used for the boot work), carried over unchanged with its
author kept.

Tested

  • Built gta6rt, gta6rt_tls_host, unimplemented_policy_test and xapu_chad_test with MSVC 2022 (Windows 11,
    RelWithDebInfo, Ninja) on this branch: all link; the two shim tests that include startup_trace.h pass.
  • Not run against the retail executable here.

GPUs tested: n/a (no GPU code)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🔄 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/576 **Author:** [@CLHelper](https://github.com/CLHelper) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `runtime/hang-dump` --- ### 📝 Commits (1) - [`e6438eb`](https://github.com/ubiquitarianism/leonida/commit/e6438eb97e3782cd7490fa67a8422563db531add) startup_trace: LEONIDA_HANG_DUMP writes every thread's stack after N seconds ### 📊 Changes **3 files changed** (+72 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/boot.md` (+3 -0) 📝 `runtime/README.md` (+1 -0) 📝 `runtime/shims/startup_trace.h` (+68 -0) </details> ### 📄 Description Claimed in the coordination issue as: RT-HANG-DUMP (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126610928) ### What and why A retail boot that faults leaves a last exception in the trace; one that hangs leaves nothing to look at. With `LEONIDA_HANG_DUMP=<seconds>`, `gta6rt` waits that long and then writes the stack of every thread in the process to the startup trace (each thread is suspended briefly while its context is read, then resumed), so a stalled boot shows where each thread waits. Unset, nothing changes: no thread is started. The code is in `runtime/shims/startup_trace.h`; `docs/boot.md` and `runtime/README.md` name the variable. The commit is 4ld0-vito's (from their fork, where it was used for the boot work), carried over unchanged with its author kept. ### Tested - Built `gta6rt`, `gta6rt_tls_host`, `unimplemented_policy_test` and `xapu_chad_test` with MSVC 2022 (Windows 11, RelWithDebInfo, Ninja) on this branch: all link; the two shim tests that include `startup_trace.h` pass. - Not run against the retail executable here. GPUs tested: n/a (no GPU code) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:29 +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#620
No description provided.