Repository navigation
Conversation
|
Verified head
AI-assisted. |
|
Tested
AI-assisted (Claude Code). |
sds-228
left a comment
There was a problem hiding this comment.
The allocation-free C++ exception path is coherent: fixed-frame capture, fixed-buffer symbolization, sink try-lock, and the registry reentry guard all match the claim. Added tests cover refused allocations, reentry, and sink contention; the Python boot-trace suite remains 22/22 and no game-data issues were found. The C++ changes are diff-review only here because no local C++ compiler is available.
AI-assisted (OpenCode).
Claimed in the coordination issue as BUILD-3308. Original claim · Coordination board
Depends on: #5805, #6410, #7189, #7423, #7503, #7514, #7524, #7723, #7824, #8002
The entries above flag rebase conflicts for merge coordination. Three-way comparisons found overlaps in the trace header (#6410, #7189, #7503, #7524, #7723, #7824, #8002), shim registry (#7189), shim declarations (#7514), PE loader (#5805) and Windows trace tests (#7423). This commit builds directly on
main@867d922f. #8506 was where the Debug failure was first observed. The regression here runs independently of XMem.What and why
With
--traceenabled, a catchablestd::bad_alloccould terminate an MSVC x64 Debug process. During first-chance exception dispatch, the tracer constructed an empty lookup string. The Debug STL attempted to allocate an iterator proxy inside itsnoexceptconstructor. Under sustained allocation failure this reachedstd::terminate, then the CRT waited in its abort dialog before the caller could catch the original exception.The C++ exception path now walks up to 16 frames and formats addresses in fixed storage. JSON retains
code,cpp,atandstack, including guest basenames andhost:<basename>+0x<RVA>for host frames. The loader publishes immutable module ranges for allocation-free lookup. If the guest registry is busy, the tracer can fall back to a raw address. If another writer owns the exception buffer or the output lock, the handler skips that event and lets dispatch continue.Tested
operator new.gta6rtin Debug and RelWithDebInfo. The nativestartup_traceCTest passed 15 consecutive runs in each configuration, 39 checks per run. It checks the exact host and guest RVAs, persistent allocation failure, registry reentry, and continued logging after sink contention. Theloader,module_names,unimplemented_policyandint3_skiptests passed in both builds. The Python boot trace reader passed all 22 tests.gta6rt --dry-run --traceCLI with a synthetic DLL and a missing file in both builds. The process returned the expected exit codes (0 and 1). The exception JSONL parsed with contiguous sequence numbers and contained symbolized runtime frames. The Debug XMem regression from xmem: roll back physical page allocation on metadata exhaustion (BUILD-3078) #8506 also passed 3 runs of 243 checks against this tracer.test_image_atomics_guardandtest_image_store_d16). In a separate integration run with tests/semantic: three image test files red on main (stale after #4473 and #6805; LLVM_MC on Windows) #7284 at6a591b77, the same suite reported zero failures and 33 skips. The three Python files from tests/semantic: three image test files red on main (stale after #4473 and #6805; LLVM_MC on Windows) #7284 are outside this PR.git diff --checkand the repository's no-game-data check passed for all six changed files.Test environment
Windows 11 Pro for Workstations 26H2 x64 (26300.9711), Intel Core i9-14900K (24 cores / 32 threads), 128 GiB RAM, NVIDIA GeForce RTX 4090 (24 GB), driver 621.14. The native tests used the CPU and synthetic inputs. Visual Studio 2022 Build Tools 17.14.39, MSVC 19.44.35228.0 (v143, x64, C++20), Windows SDK 10.0.26100.0, CMake/CTest 3.31.6-msvc6, Ninja 1.12.1 and Python 3.12.10.
AI-assisted: yes, with OpenAI Codex.
Checklist