[PR #1096] [CLOSED] runtime: report the memory region for a traced access violation (RT-STARTUP-TRACE) #1130

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

📋 Pull Request Information

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

Base: main ← Head: split/rt-startup-trace


📝 Commits (1)

  • 51868df runtime: report the memory region for a traced access violation (RT-STARTUP-TRACE)

📊 Changes

2 files changed (+10 additions, -0 deletions)

View changed files

📝 runtime/shims/startup_trace.h (+8 -0)
📝 runtime/test/startup_trace_test.cpp (+2 -0)

📄 Description

Claimed in the coordination issue as: RT-STARTUP-TRACE (claim).

Part of the split of #984 into small pull requests.

Depends on: none
Overlaps: #984 (integration source). #41 adds caller information for a null target. #638 handles breakpoint skipping. Neither records the faulting address's memory region.

What and why

The opt-in startup trace records the address and operation of an access violation. Those fields alone cannot distinguish an unallocated range from a committed read-only page or a mapped view. When VirtualQuery succeeds, the exception event now includes the region base, allocation base, size, state, protection and type. A failed query leaves the rest of the event available. The handler continues exception processing as before.

Startup tracing remains off by default. Enable it with gta6rt --trace FILE.

Tested

Cross-built with clang-cl 23 and the xwin SDK. Ran the synthetic exception fixture under Proton Experimental (Wine 11) on CachyOS Linux 7.3, Ryzen 5 5600X and 16 GB RAM.

cmake --build runtime/build/boot --target gta6rt startup_trace_test -j6
ctest --test-dir runtime/build/boot -j1 -R '^startup_trace$' --output-on-failure
python3 -I scripts/check_no_game_data.py runtime/shims/startup_trace.h runtime/test/startup_trace_test.cpp
git diff --check
  • Base 3aa975421 with the new assertion passed 26/27 checks. The trace lacked the faulting page's region.
  • Child passed 27/27 checks and 1/1 CTest. The synthetic access violation reported free memory. The test also checks the access kind, exception location and stack.
  • Native Windows and AMD/Intel GPU runs were not performed.

GPUs tested: none. The fixture exercises CPU memory and exception tracing.
AI-assisted: yes

Checklist

  • Based on current upstream main at the cut. Merge check passed against the subsequently fetched main.
  • One topic with a synthetic regression test.
  • Content guard and whitespace check passed.
  • No translator rule changed.

🤖 Generated with 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/1096 **Author:** [@Moriz82](https://github.com/Moriz82) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `split/rt-startup-trace` --- ### 📝 Commits (1) - [`51868df`](https://github.com/ubiquitarianism/leonida/commit/51868dfbe58a868029f1ad7fb4ebc0327c6cc724) runtime: report the memory region for a traced access violation (RT-STARTUP-TRACE) ### 📊 Changes **2 files changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/startup_trace.h` (+8 -0) 📝 `runtime/test/startup_trace_test.cpp` (+2 -0) </details> ### 📄 Description Claimed in the coordination issue as: RT-STARTUP-TRACE ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140523327)). Part of the split of #984 into small pull requests. Depends on: none Overlaps: #984 (integration source). #41 adds caller information for a null target. #638 handles breakpoint skipping. Neither records the faulting address's memory region. ### What and why The opt-in startup trace records the address and operation of an access violation. Those fields alone cannot distinguish an unallocated range from a committed read-only page or a mapped view. When `VirtualQuery` succeeds, the exception event now includes the region base, allocation base, size, state, protection and type. A failed query leaves the rest of the event available. The handler continues exception processing as before. Startup tracing remains off by default. Enable it with `gta6rt --trace FILE`. ### Tested Cross-built with clang-cl 23 and the xwin SDK. Ran the synthetic exception fixture under Proton Experimental (Wine 11) on CachyOS Linux 7.3, Ryzen 5 5600X and 16 GB RAM. ```sh cmake --build runtime/build/boot --target gta6rt startup_trace_test -j6 ctest --test-dir runtime/build/boot -j1 -R '^startup_trace$' --output-on-failure python3 -I scripts/check_no_game_data.py runtime/shims/startup_trace.h runtime/test/startup_trace_test.cpp git diff --check ``` - Base `3aa975421` with the new assertion passed 26/27 checks. The trace lacked the faulting page's region. - Child passed 27/27 checks and 1/1 CTest. The synthetic access violation reported free memory. The test also checks the access kind, exception location and stack. - Native Windows and AMD/Intel GPU runs were not performed. GPUs tested: none. The fixture exercises CPU memory and exception tracing. AI-assisted: yes ### Checklist - [x] Based on current upstream main at the cut. Merge check passed against the subsequently fetched main. - [x] One topic with a synthetic regression test. - [x] Content guard and whitespace check passed. - [x] No translator rule changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:11 +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#1130
No description provided.