You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
runtests: Tests can pass while rtapi_app crashes #4707
This is the slave rtapi_app or the master when at the exit point, I guess. While it is problematic that the test succeeds with a crashed rtapi_app, the actual test did succeed.
Just like the shmem test added to runtests, we should check for segfaults/code dumps after each test and fail accordingly.
This is the slave rtapi_app or the master when at the exit point, I guess. While it is problematic that the test succeeds with a crashed rtapi_app, the actual test did succeed.
Just like the shmem test added to runtests, we should check for segfaults/code dumps after each test and fail accordingly.
Exactly, this was the idea. They might also be other processes crashing and if there are no side effects, no one will notice.
@grandixximo Before taking this on, I wanted to spend some time in improving the real time doc and add a few tools to simplify configuration. If you would like to take this on, feel free. Just tag me so we don't do it at the same time... ;-)
@hdiethelm I won't take this on, but I ran your repro in a few configurations, in case the results save you time.
Setup: master 07aa2ba, stock Debian 6.12 kernel, crash patch from the issue, runtests tests/abs.0 in private ipc/pid/net namespaces, ulimit -c unlimited, core_pattern=core. abs.0 passed in every run.
rtapi_app
rtapi_app: SIGSEGV - aborting in stderr
core, suid_dumpable=0 / 2
plain, POSIX non-realtime
no
yes / yes
setcap, LINUXCNC_FORCE_REALTIME=1
yes
yes / yes
setuid, LINUXCNC_FORCE_REALTIME=1
yes
no / no
rtapi_app: failed to read from master was in the test's stderr in every run (the slave waiting for the exit reply).
The signal handler is only installed in harden_rt(), which only runs for a realtime type, so in POSIX mode (CI, most runtests runs) nothing is printed.
setuid: the prctl(PR_SET_DUMPABLE, 1) does not survive. With suid_dumpable=2 the kernel logs rtapi_app: this process can only dump core to a fully qualified path, skipping core dump, so the flag was reset; prctl(2) says any fsuid change does that, and WithRoot calls setfsuid(). With setcap there is no fsuid change and the core is written.
Once the handler is installed, the kernel no longer logs segfault at ... (only the POSIX runs did), and dmesg needs CAP_SYSLOG anyway.
Without raising the limit, Debian's default soft core 0 meant no core at all in POSIX mode.
So a journal/coredump scan would miss the setuid case and depends on systemd, while the stderr lines are there regardless of distro, privileges or sandbox.
For reference, other projects mostly fail a test when a process it started dies from a signal (PostgreSQL, piglit, QEMU iotests, GLib, Wine, LTP); systemd scans coredumpctl but owns the whole VM. For a daemon that is not a child of the runner, prctl(PR_SET_CHILD_SUBREAPER, 1) (as tini -s does) re-parents it to the runner so waitpid() sees the signal; that needs a small C or Python helper since bash cannot set it.
Activity
BsAtHome commentedon Oct 21, 2026
This is the slave rtapi_app or the master when at the exit point, I guess. While it is problematic that the test succeeds with a crashed rtapi_app, the actual test did succeed.
Just like the shmem test added to runtests, we should check for segfaults/code dumps after each test and fail accordingly.
grandixximo commentedon Oct 26, 2026
@hdiethelm #4648 merged, are you taking this on?
hdiethelm commentedon Oct 26, 2026
Exactly, this was the idea. They might also be other processes crashing and if there are no side effects, no one will notice.
@grandixximo Before taking this on, I wanted to spend some time in improving the real time doc and add a few tools to simplify configuration. If you would like to take this on, feel free. Just tag me so we don't do it at the same time... ;-)
grandixximo commentedon Oct 28, 2026
@hdiethelm I won't take this on, but I ran your repro in a few configurations, in case the results save you time.
Setup: master 07aa2ba, stock Debian 6.12 kernel, crash patch from the issue,
runtests tests/abs.0in private ipc/pid/net namespaces,ulimit -c unlimited,core_pattern=core.abs.0passed in every run.rtapi_app: SIGSEGV - abortingin stderrLINUXCNC_FORCE_REALTIME=1LINUXCNC_FORCE_REALTIME=1rtapi_app: failed to read from masterwas in the test'sstderrin every run (the slave waiting for theexitreply).harden_rt(), which only runs for a realtime type, so in POSIX mode (CI, most runtests runs) nothing is printed.prctl(PR_SET_DUMPABLE, 1)does not survive. Withsuid_dumpable=2the kernel logsrtapi_app: this process can only dump core to a fully qualified path, skipping core dump, so the flag was reset; prctl(2) says any fsuid change does that, andWithRootcallssetfsuid(). With setcap there is no fsuid change and the core is written.segfault at ...(only the POSIX runs did), and dmesg needs CAP_SYSLOG anyway.core 0meant no core at all in POSIX mode.So a journal/coredump scan would miss the setuid case and depends on systemd, while the stderr lines are there regardless of distro, privileges or sandbox.
For reference, other projects mostly fail a test when a process it started dies from a signal (PostgreSQL, piglit, QEMU iotests, GLib, Wine, LTP); systemd scans
coredumpctlbut owns the whole VM. For a daemon that is not a child of the runner,prctl(PR_SET_CHILD_SUBREAPER, 1)(astini -sdoes) re-parents it to the runner sowaitpid()sees the signal; that needs a small C or Python helper since bash cannot set it.Your call how to proceed.