feat: add game launch tracking and crash detection#92
Open
seventhback777 wants to merge 2 commits into
Open
Conversation
- Process.h/cpp: overload processRunning() to return exit code; add killProcess() to terminate the full game process group via SIGTERM; improve error reporting and forward game stdout to stderr for debugging - Menu.h/cpp: add m_launching, m_launchTime, m_launchError, m_lastExitCode to track game launch state and detect crashes; fix memory leak in destructor by freeing all ButtonNode/Button objects in the linked list; improve image load error reporting - Process.cpp: use waitpid(WNOHANG) instead of getpgid for non-blocking exit-code capture; set new process group with setpgid so kill() covers the full game tree - Option.h/cpp: add destructor declaration; fix include order - AboutScreen.h/cpp: add m_gitContributions field for contributor stats - ArcadeMachine.cpp, Button.cpp, program.cpp: corresponding updates
RealH4D35
approved these changes
May 23, 2026
There was a problem hiding this comment.
Review
Tested on: Arch Linux
Compilation fixes needed (add these upstream):
src/ConfigData.cpp: add#include <cstring>and#include <sys/stat.h>.src/Option.cpp: addconst int ROWS = 2; const int COLS = 2;beforecreateOptionsButtons().
Features work as expected:
spawnProcesssets process group;waitpid(WNOHANG)captures exit codes.- “Starting...” animation and on‑screen crash/launch errors appear.
ESCkills the entire game process group cleanly.- Memory leaks fixed:
MenuandOptiondestructors free button lists. - Improved logging for image loading and resource bundles.
Pre‑existing issues (not caused by this PR):
- Database stubs from PR #91 (or missing SplashKit DB API) still cause “Table creation failed”. This PR does not touch the database layer.
- Some games lack Linux binaries or have symbol mismatches – unrelated to launch tracking.
Relationship to PR #91:
- PR #91 (
fix/cross-platform-fixes) is a separate branch that also modifies database stubs andButton.cpp. The two PRs are independent but may conflict. I recommend merging PR #91 first (after fixing itsButton.cppcompilation error) and then rebasing this PR on top.
Ready to merge after adding the three missing declarations/includes.
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.
Summary
processRunning()to return exit code; addkillProcess()to terminate the full game process group via SIGTERM; improve error reportingm_launching,m_launchTime,m_launchError,m_lastExitCodeto track game launch state and detect crashes; fix memory leak in destructor (ButtonNode linked list was never freed)waitpid(WNOHANG)instead ofgetpgidfor non-blocking exit-code capture;setpgid(0,0)in child sokill(-pid)covers the full game treem_gitContributionsfield for contributor statsTest plan