Repository navigation
runtime: a Debug build compiles (/bigobj) and catches C++ exceptions in a Debug image - #4086
Conversation
A Debug build stopped at shims/d3d12_vulkan_device.cpp with fatal error C1128: the object has more sections than a COFF object holds by default, because without optimisation every inline function keeps its own COMDAT. CI builds RelWithDebInfo only, so nothing showed it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
prefer_host_copy() listed the release names of the MSVC runtime DLLs only. A Debug build of a stand-in image imports VCRUNTIME140D.dll, VCRUNTIME140_1D.dll and MSVCP140D.dll, so the loader did not redirect their RtlPcToFileHeader import, _CxxThrowException could not find the throwing image, and a C++ exception thrown and caught inside the image ended the run with 0xE06D7363 (run_tiny_game_eh in a Debug build). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested 174b87c with an MSVC Debug build: VS 2022 Build Tools, MSVC 19.44, Ninja,
So the No game files. AI-assisted (Claude). |
|
Independent Debug comparison using the Visual Studio 17 2022 generator on Windows 11 build 26200, x64, MSVC 19.44.35227, Windows SDK 10.0.26100.0.
The two CPU CTests used freshly built Debug executables and synthetic fixtures. The D3D12 COM check was a separate compile. AI-assisted. |
Claimed in the coordination issue as: new BUILD/RT item, claim in #3918 (no ID yet).
Depends on: #3680, for a fully green Debug run only. That PR fixes the two no-CRT fixtures that fail to link in Debug; this one doesn't touch them and compiles and passes its own tests without it.
What and why
CI builds the runtime as RelWithDebInfo. A Debug build (
-DCMAKE_BUILD_TYPE=Debug, orscripts\build_runtime.ps1 -Debug) had two problems of its own. Two commits, one each.1. It doesn't compile (
f53e22e,runtime/CMakeLists.txt). The compiler's message, in its English wording (this machine prints it in Italian):Without optimisation every inline function keeps its own COMDAT section, and that file has more than a COFF object holds by default.
gta6rt_d3d12_comthen doesn't build and 74 of the 145 tests have nothing to run. The target gets/bigobj. It changes the object format only, not the code.2.
run_tiny_game_ehfails with0xE06D7363(174b87c,runtime/src/pe_loader.cpp):prefer_host_copy()lists the release names of the MSVC runtime DLLs, and that list is also what decides where the loader redirectsRtlPcToFileHeader(lines ~1087-1124). A Debug build of the stand-in game importsMSVCP140D.dll,VCRUNTIME140D.dllandVCRUNTIME140_1D.dll(dumpbin /dependents), which were not in it. So_CxxThrowExceptionasked Windows for the throwing image, got nothing for a mapped one, and the exception thrown and caught inside the image was never matched to its catch. The Debug names of the same ten DLLs are added. The process shim already servesucrtbased.dllfor the same Debug build of that fixture.The retail executable links the release runtime, so this is about the project's own Debug builds and their tests, not about the game.
Tested
Windows 11 26200, MSVC 19.42 (VS 2022 Build Tools), Ninja, Windows SDK 10.0.28000.0, Vulkan headers from SDK 1.4.363.0, NVIDIA RTX 3080 Ti, driver 616.56. No game files.
mainaa2988cd3d12_vulkan_device.cpp, LNK2001/LNK1120 in the two fixtures; 74 of 145 tests fail (not built)run_tiny_game_ehfails, exit0xE06D7363aftertiny_game: SKIP thread_localmainhereThe two fixtures were borrowed from #3680 in the working tree for the Debug runs and are not in these commits.
gta6rt_d3d12_comandrun_tiny_game_ehdon't depend on them.Not tested: the Visual Studio generator (Ninja only), clang-cl (it accepts
/bigobj, but I didn't run the cross-build), and the seven tests that needllvm-mc, which aren't built here in either configuration.Checklist
docs/design.md, with how it was confirmed. (Not applicable.)AI-assisted (Claude Code).
🤖 Generated with Claude Code