Repository navigation
Exit with the real exit code on Windows - #47
Merged
Merged
Conversation
The hosted Linux runner moved to Ubuntu 26.04, whose GCC 15 reports -Wnull-dereference (an error in CI) in three files: - Copies of file-scope default vectors written through operator[]: GCC can't see that a dynamically initialised global is non-empty. Use .at() for those writes in test_mod_routes.cpp and bench_devices.cpp. - memcpy from an empty vector's data() in bench_devices.cpp: skip the copy when there is nothing to copy (memcpy from null is undefined even for zero bytes). - sorted.back() on a possibly empty timing vector in bench_render.cpp: guard it the way run_render already does.
After any run that opened the window, a normal process exit on Windows reported 0x87A instead of 0: the code is replaced after main returns, while the process unloads its DLLs (same with or without audio, a screenshot or presented frames; an exit before the window exists is 0). The app now ends its process directly once run() has returned, and CI and the release smoke test check the exit code on Windows too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #40. On Windows the app exited with 0x87A instead of 0 after a passing screenshot or self-test run, so CI could not check the exit code there.
What the probe showed
A diagnostic run on the hosted Windows runner (WARP, DX12; #45, now closed) ran the app in several variants and printed each exit code:
--no-audio--no-audiostd::process::exit(0)afterrun()returnedTerminateProcess(…, 0)afterrun()returnedSo
run()returnsOkevery time, and the audio backend, the screenshot and frame presentation are not involved. The code is replaced aftermainhands control to the normal process exit, while DLLs unload, and only once the window (and with it the wgpu device, which Slint keeps in a thread-local backend) has existed. 0x87A is the DXGI facility number, which points at the graphics stack's own shutdown. Which DLL does it has not been pinned down, and it has only been seen with WARP; a real GPU still needs checking on a Windows machine.The fix
Once
run()has returned, everything of ours is already closed (project, settings, engine), so on Windowsmainflushes stdout and stderr and ends the process directly with its real code (exit_now). Other systems exit as before. A failure insiderun(), or a crash while it tears down, still gives a non-zero code.CI now fails the Windows screenshot and self-test steps on a non-zero exit code, and the release smoke test does the same for the installed app.
engine/README.mddescribes the cause as far as it is known in place of "not yet explained".This branch also carries the GCC 15 build fix from #41 so the Linux job can pass.
Screenshots
No visual change.
Benchmarks
No change to anything that runs while the app is open; process exit on Windows skips DLL unloading and is, if anything, faster.
Docs
Generated by Claude Code