Skip to content

runtests: Tests can pass while rtapi_app crashes #4707

Open

Description

@hdiethelm

Discovered while searching for issues in: #4669

Steps to reproduce:

  1. Trigger a segfault at rtapi_app exit
diff --git a/src/rtapi/uspace_rtapi_main.cc b/src/rtapi/uspace_rtapi_main.cc
index 9946f3d16d..8dcf213e36 100644
--- a/src/rtapi/uspace_rtapi_main.cc
+++ b/src/rtapi/uspace_rtapi_main.cc
@@ -1003,6 +1003,7 @@ static int handle_command(const std::vector<std::string> &args, std::string &out
         return 0;
     } else if (args.size() == 1 && args[0] == "exit") {
         force_exit = 1;
+        *(volatile int *)0 = 0; //Trigger a segfault at exit
         return 0;
     } else if (args.size() >= 2 && args[0] == "load") {
         std::string name = args[1];
  1. Run a test
scripts/runtests tests/abs.0
Running test: tests/abs.0
Runtest: 1 tests run, 1 successful, 0 failed, 0 skipped, 0 shmem errors
  1. dmesg: There was a segfault during the test but it passed. I would expect the test to fail.

An idea to solve this was discussed in #4703 (comment)

#4648 should be merged before starting this to avoid merge conflicts.

Activity

  1. BsAtHome commented on Oct 21, 2026

    @BsAtHome
    Contributor

    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.

  2. grandixximo commented on Oct 26, 2026

    @grandixximo
    Contributor

    @hdiethelm #4648 merged, are you taking this on?

  3. hdiethelm commented on Oct 26, 2026

    @hdiethelm
    ContributorAuthor
    1. 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... ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions