Skip to content

tests: ptp-iterative prints where its UI crashes - #4873

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:ptp-iterative-faulthandler
Open

grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:ptp-iterative-faulthandler

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

The UI of tests/ptp-iterative segfaulted once on CI (rip-headless on #4870, exit 139; a rerun passed) and left nothing to show where: the lines it had printed were still in the stdout buffer the crash threw away, and Python prints no stack on a fatal signal by default. I could not reproduce it locally.

*** ./tests/ptp-iterative: FAIL: test run exited with 139
************** result:
        Starting LinuxCNC...
        !!! switchkins-type 0 is genserkins
        !!! switchkins-type 0 is genserkins
        Shutting down and cleaning up LinuxCNC...
        task: 264 cycles, min=0.000002, max=0.028290, avg=0.009473, 0 latency excursions (> 10x expected cycle time of 0.010000s)
        !!! switchkins-type 0 is genserkins
        switchkins-type 0 declared: primary machine
        switchkins-type 1 declared: identity
        LinuxCNC terminated with an error.
************** stderr:
        .../scripts/linuxcnc: line 987: 66016 Segmentation fault      (core dumped) $EMCDISPLAY -ini "$INIFILE" "${EMCDISPLAYARGS[@]}" "${EXTRA_ARGS[@]}"

This enables faulthandler, so a fatal signal prints the Python stack to stderr, which runtests shows on a failure, and line-buffers stdout so the lines printed before the crash reach the log.

I checked it by forcing a segfault before the second preview: the stack names the line, and the output up to it is in the result.

The UI of tests/ptp-iterative segfaulted once on CI (rip-headless, exit 139) and left nothing to show where: the lines it had printed were still in the stdout buffer the crash threw away, and Python gives no stack on a fatal signal by default.

Enable faulthandler, so a fatal signal prints the Python stack to stderr, which runtests shows on a failure, and line-buffer stdout so the progress lines printed before the crash reach the log.

Checked by forcing a segfault before the second preview: the stack names the line, and the output up to it is in the result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant