Repository navigation
Conversation
R0Y00#1758) tools/startup/msvc_throw_info.py reads the public x64 throw info (magic, thrown object, _ThrowInfo, _CatchableTypeArray, _CatchableType, type_info name) through a read_mem callback and returns a record with no address and no path: the catchable types (built-in scalars and public library classes by name, any other class as other) and, for a thrown 32-bit scalar such as long, the HRESULT as a public name with its facility. It is not wired into debug_launch.py yet.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
R0Y00
left a comment
There was a problem hiding this comment.
Please tighten the public summary allowlist. _describe_value treats every 32-bit scalar with bit 31 set as an HRESULT, then emits its raw hex in both the record and the one-line description. A thrown integer with that bit set can be private application data. Keep named, recognized HRESULTs such as E_INVALIDARG, and classify an unrecognized high-bit value without printing its bits in the shareable output. Add a synthetic scalar sentinel and check both the returned record and describe(). The core can still run independently of the startup debugger.
A thrown 32-bit scalar with bit 31 set is only named when it is a recognized public HRESULT. Any other value is reported as unrecognized_failure with no code, bits or facility, in both the record and describe(). Adds a synthetic sentinel test for both outputs.
|
Addressed in 9a3c446.
Verification:
AI-assisted; commands listed were executed locally. |
|
Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is. We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here. AI-assisted; commands listed were executed locally. |
# Conflicts: # CMakeLists.txt
|
Reopened and brought up to date: origin/main ( Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
Linux at the same head: The description now starts with the AI-assisted; commands listed were executed locally. |
|
@MasterDomino Ready for review: head Independent Stage-2 check on this exact head, Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP), Proxmox slots, dev and release Review result: records of a thrown Non-blocking: a thrown number up to 65535 is printed as a number (for example AI-assisted; commands listed were executed locally. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Part of #1758 (and #870)
What this unblocks: the startup debugger can report which HRESULT a C++ exception carried when a run ends on
0xE06D7363, as a short public summary with no address, path or name from the title.This is the decoder only: it is not wired into
tools/startup/debug_launch.py(untouched, so it does not collide with the other open PRs that edit that file). The follow-up that calls it at the first-chance stop is a separate change.Source: the MSVC runtime header
ehdata.h(shipped with the Visual Studio C runtime sources) for the0xE06D7363parameters and the_ThrowInfo/_CatchableTypeArray/_CatchableTypelayout; Raymond Chen, The Old New Thing (Microsoft Dev Blogs), "Decoding the parameters of a thrown C++ exception (0xE06D7363)"; Microsoft Learn, "EXCEPTION_RECORD structure (winnt.h)"; Microsoft Learn, "DXGI_ERROR" and "Direct3D 12 return codes", andwinerror.h(Windows SDK) for the HRESULT names and values.Verification (head
49ca19e34, origin/main9b45cbb44merged in with a merge commit):x2w_pipe.py win2025 1939 --host proxmox --regex '^startup_msvc_throw_info$':ctest --preset dev -R '^startup_msvc_throw_info$' --no-tests=error --output-on-failure: 1/1 passed (startup_msvc_throw_info)./O2:ctest --preset release -R '^startup_msvc_throw_info$' --no-tests=error --output-on-failure: 1/1 passed (startup_msvc_throw_info).python3 -B tests/startup_msvc_throw_info_check.pyPASS;tests/docs_links_check.py,tests/bidi_controls_check.py,tests/startup_tools_lint_check.pypass;git diff --check origin/main...HEADclean.What it does
tools/startup/msvc_throw_info.pyturns a0xE06D7363exception record into a sanitized summary. #1758 needs the thrown HRESULT of the BVH builder, whose throw info says the catchable type is the built-inlong(.J), without putting addresses or names from the title in a public comment.decode_throw(exception_code, params, read_mem)follows the public MSVC x64 layout (ehdata.h):params[0]magic,[1]thrown object,[2]_ThrowInfo,[3]image base;_ThrowInfo→ RVA of_CatchableTypeArray→ RVAs of_CatchableType→ RVA oftype_info, whose decorated name is at offset 16.read_mem(address, size) -> bytes | Noneis the only access to memory, so the core has no Win32 dependency: indebug_launch.pyit would be the existingread.The record it returns has:
status:ok,not_msvc_exception,missing_parameters(fewer than four, so no image base),bad_magic,no_throw_info,unreadable,bad_throw_info,too_many_types(cap of 16, a safety limit).types: one entry per catchable type. Built-in scalars and a short list of public library classes (std::runtime_error,_com_error, ...) are named; any other class isother, so a class of the title never appears.value, only when the first catchable type is a 32-bit scalar (.J,.H,.I,.K) of size 4: the HRESULT as a public name (E_INVALIDARG,E_OUTOFMEMORY,DXGI_ERROR_DEVICE_REMOVED,DXGI_ERROR_DEVICE_HUNG,D3D12_ERROR_*, commonHRESULT_FROM_WIN32(...)), orHRESULT(0x........), with its facility category (win32,dxgi,d3d12,other). A positive number above 65535 is not reported.describe(record)gives a one-line form made of those fields only.Test
tests/startup_msvc_throw_info_check.pybuilds synthetic exception records in a fake address space (no title data) and checks 89 cases: ten HRESULTs through.J(E_INVALIDARG,E_OUTOFMEMORY,DXGI_ERROR_DEVICE_REMOVED, a generic one, ...),.Hand.I, another exception code, wrong magic, three parameters, null throw info and image base, a read that fails at each of the four steps (and a callback that returns short data or raises), an RVA beyond the readable range and one that overflows 64 bits, a negative count, 16 and 17 catchable types, a zero RVA,runtime_error,_com_error, a class of the title, alongof the wrong size, malformed names, a name that ends before unmapped memory, and a sweep that no record contains an address, a path, long hex or a number over 32 bits.It is registered in
CMakeLists.txtafterstartup_triage_runand in the Python check list of.github/workflows/windows.ymlnext tostartup_triage_run_check.py.Results (Linux, local; mutation and merge-tree runs at the earlier head 9a3c446)
python3 -B tests/startup_msvc_throw_info_check.py: 89 ok, PASS (head 49ca19e).msvc_throw_info.py, each restored withgit checkout --; all nine fail the test: magic not checked, facility0x87Achanged to0x87B, cap>=instead of>, other classes reported by name, negative count accepted, type name read at +8, scalar size not checked, two DXGI names swapped, a raising callback not caught.tests/docs_links_check.pyandtests/bidi_controls_check.pypass;git diff --check origin/main...HEADis clean.git merge-treeof this branch against the head of every open PR (109, including startup: hold other threads while a hook steps over its byte #1408, startup: pass OMSetStencilRef (slot 24) to the desktop list #1787, startup: name the command list slots the noop log can state #1788, build: write the variants of each x87 fixture in one Python process #1789): no conflict thatorigin/maindoes not already have.Not run, not established
HRESULT(0x........)with its facility.AI-assisted; commands listed were executed locally.