I regularly run a GUI binary through CI tests using Github Actions. Occasionally, the binary crashes unexpectedly. This issue is difficult to reproduce, so I'd like to capture a stack trace whenever it occurs.
To achieve this, I'm using xvfb-run and gdb:
xvfb-run --auto-servernum gdb --batch -ex "run" -ex "bt full" --args ${{github.workspace}}/src/mudlet --profile 'Mudlet self-test' --mirror
However, this command always exits with code 1, which according to the xvfb-run documentation, indicates an error in the child process (gdb). I believe gdb returns this exit code because there's typically no stack trace to print.
As a workaround, I've added -ex "quit 0" to the GDB command, but this prevents the workflow from failing if a genuine crash happens.
How can I reliably capture a stack trace when the binary crashes and avoid workflow failures when no issues occur?
Asked by Vadim Peretokin
(131 rep)
Aug 11, 2024, 04:09 PM
Last activity: Aug 11, 2024, 04:30 PM
Last activity: Aug 11, 2024, 04:30 PM