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
When reach was used from python script, I got "core dumps", while debugging I found out that RuntimeError was throwed. It was throwed from signal handler. Problem is that function runReachStudy already finished, but signals handlers left installed. This causes my application to fail with core dumps.
I removed signal handlers in the end of the function.
diff --git a/src/third_party/reach/src/reach_study.cpp b/src/third_party/reach/src/reach_study.cpp
index 0c9e0b4..317a3cc 100644
--- a/src/third_party/reach/src/reach_study.cpp+++ b/src/third_party/reach/src/reach_study.cpp@@ -382,6 +382,9 @@ void runReachStudy(const YAML::Node& config, const std::string& config_name, con
logger->print("Press enter to quit");
std::cin.get();
}
++ signal(SIGINT, SIG_DFL);+ signal(SIGTERM, SIG_DFL);
}
} // namespace reach
What is the purpose of signal handlers in general? especially that they installed in the end of the function, when study already finished?
The text was updated successfully, but these errors were encountered:
What is the purpose of signal handlers in general?
The purpose of signal handlers is to call a user-provided function when OS signals (like SIGINT and SIGTERM) are emitted and before they terminate the program.
I think I implemented this to get around the issue of ROS2 launch not allowing input from stdin needed to terminate the reach study. In order to interact with the reach study markers, the reach study objects in that function need to stay in scope. In ROS1 we can wait for keyboard input to terminate the reach study once we are done interacting with the markers, but this doesn't work in ROS2. Instead, we still wait for keyboard input (which we can't get), but I re-routed the SIGINT and SIGKILL signals to a throw an exception that could be handled appropriately at the higher level (but currently isn't really handled). In retrospect, I don't think this really makes sense, and we could probably just get rid of the signal handling.
Thanks for the great library. Small nitpick.
When reach was used from python script, I got "core dumps", while debugging I found out that RuntimeError was throwed. It was throwed from signal handler. Problem is that function runReachStudy already finished, but signals handlers left installed. This causes my application to fail with core dumps.
I removed signal handlers in the end of the function.
What is the purpose of signal handlers in general? especially that they installed in the end of the function, when study already finished?
The text was updated successfully, but these errors were encountered: