Repository navigation
gta6rt: keep a crashed run out of Windows Error Reporting (no locked gta6rt.exe, LNK1168) - #7717
Open
thedarkcr0w wants to merge 1 commit into
Open
thedarkcr0w wants to merge 1 commit into
thedarkcr0w wants to merge 1 commit into
Conversation
A run that ends in an unhandled exception was reported to WER. Now and then the report left the ended run behind as a process with no threads that Stop-Process cannot end, keeping runtime\build\gta6rt.exe open so the next build failed with LNK1168 until the file was renamed or the machine restarted (the same mechanism ItsNotRexed#6460 fixes for tiny_game_abort_test's children). gta6rt now sets SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX first thing, so a relaunched gta6rt (base_reservation.h) inherits it. The exit code is still the exception's code. LEONIDA_WER=1 keeps the system default for anyone who wants a WER dump. tiny_game gains an error-mode probe and a crash mode; tiny_game_wer_test starts gta6rt with CREATE_DEFAULT_ERROR_MODE and checks the mode with and without LEONIDA_WER=1 and that a crash still exits with 0xC0000005. AI-assisted.
Claimed in #7496 (new RT item: #7496 (comment)).
Problem. A
gta6rt --runthat ends in an unhandled exception is reported to Windows Error Reporting. Now and then the report leaves the ended run behind as agta6rt.exewith no threads thatStop-Process -Forcecannot end. It keepsruntime\build\gta6rt.exeopen, so the next build fails withLINK : fatal error LNK1168: cannot open gta6rt.exe for writinguntil the file is renamed or the machine restarts. Anyone iterating on the retail boot (docs/boot.md, docs/retail_boot_chain.md) hits it. #6460 fixes the same mechanism fortiny_game_abort_test's children; nothing coveredgta6rt.exeitself.Change.
runtime/src/main.cpp: the first thingwmaindoes isSetErrorMode(GetErrorMode() | SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX), before the base-reservation relaunch, so a relaunchedgta6rtinherits it. The run still ends with the exception's code as its exit code.LEONIDA_WER=1keeps the system default for anyone who wants a WER dump. Nothing outside the process is changed (no registry WER exclusion).runtime/test/fixtures/tiny_game.cpp: two modes,error-mode(exit 43 whenSEM_NOGPFAULTERRORBOXis set, 44 when not) andcrash(an unhandled access violation).runtime/test/tiny_game_wer_test.cpp(CTestrun_tiny_game_wer): startsgta6rtwithCREATE_DEFAULT_ERROR_MODEso it cannot inherit CTest's mode, then checks the mode by default and withLEONIDA_WER=1, and that a crash still exits with0xC0000005.docs/boot.md:LEONIDA_WERin the list of switches.Tested on Windows 11 (10.0.26200), MSVC 2022 Build Tools
RelWithDebInfo, NVIDIA GeForce RTX 4090 (driver 32.0.16.1062), at main99d799a64:tiny_game_wer_testSEM_NOGPFAULTERRORBOX(exit 44)tiny_gamecrash undergta6rt --run: exit code / Application-log events (1000/1001)0xC0000005/ 10xC0000005/ 0gta6rt --run(own 1.0.2.1 copy; on main it stops early with an unhandled exception), 4 runs each: WER events / zero-threadgta6rt.exeleft behindctestA
tiny_gamecrash is reported on main but leaves no process behind, so the test checks the error mode rather than the leftover; the leftover was seen only with the retail run (which is much larger).scripts/check_no_game_data.pypasses on the changed files. No game files are needed for the test and nothing here quotes the executable.AI-assisted (Claude Code).