Repository navigation
Conversation
gamescope exits with status 0 whatever the command after `--` returns, so a failing command looks like a success to the calling script. gamescopereaper waited for its child and then returned 0, and the gamescope-wait thread dropped the reaper's status. The reaper now returns the primary child's exit status, or 128 + N if it was killed by signal N, like a shell. gamescope returns that status, unless it was shutting down already: when gamescope itself is closed it still exits 0. A command that cannot be started now exits 127 instead of 0. Closes: ValveSoftware#2540
|
Thanks, I'll leave mine and go with this one. I tested d1a0134 nested (
One small thing from reading it, which I couldn't trigger: if the reaper gets SIGTERM after spawning but before its first |
…e wait If SIGTERM (or SIGHUP, SIGINT, SIGQUIT) reaches the reaper after the primary child is spawned but before the reaper starts waiting for it, s_bRun is already false and the wait is skipped. The child is then reaped by the final argument-less WaitForAllChildren(), its status is lost and the reaper returns 0 instead of 143. With --respawn the same window returned the status of the previous instance. Wait for the primary child explicitly when it has not been reaped yet. Reported-by: JROtto5 <222316562+JROtto5@users.noreply.github.com>
|
Thanks a lot @JROtto5, both for testing on NVIDIA nested and for reading the code closely: you're right about that window. I could reproduce it under gdb by stopping the reaper right after Fixed in 62deb3e, with you credited as |
|
Thanks for the credit, and for chasing it down under gdb. I re-ran the same NVIDIA nested set on 62deb3e: exits are unchanged (0, 7, 1, 139, 137, 127; 0 when gamescope itself gets SIGTERM, 2/2), gamescopereaper alone exits 143 on SIGTERM, and |
gamescope exits with status 0 whatever the command after
--returns (#2540). This makes gamescopereaper return the primary child's exit status (128 + N for signal N), and gamescope return it in turn, except when gamescope itself is being shut down, which still exits 0. A command that cannot be started exits 127, like a shell.Tested with
--backend headlesson CachyOS (RADV RENOIR):truesh -c 'exit 7'falsesh -c 'kill -SEGV $$'sh -c 'kill -KILL $$'/nonexistent/cmdNew tests in
tests/test_process.cpprun the built gamescopereaper;meson testpasses (75/75).Closes #2540