[ros2] Calling std::terminate in a composed node?
If I call std::terminate
in one component of a composed node, the component dies, but something around launch
continues to live. I don't get back to the command prompt, and hitting ctrl+c does nothing. This is what I see in terminal output:
[component_container-1] terminate called without an active exception
[ERROR] [component_container-1]: process has died [pid 164629, exit code -6, cmd
'/opt/ros/foxy/lib/rclcpp_components/component_container --ros-args -r __node:=foo_container -r __ns:=/bar'].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) again, ignoring...
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) again, ignoring...
In contrast, if I throw an uncaught exception in the component, everything dies as expected and I get dropped back to the terminal prompt.
Does anyone know why calling std::terminate
does not kill everything?
Asked by Jeffrey Kane Johnson on 2021-03-30 07:59:15 UTC
Comments
Hmm, I don't know how your launch file looks like, but this appears to be a bug. Have you tried to reproduce on Rolling? Might be related to https://github.com/ros2/launch/pull/476. If that doesn't do, I'd suggest you file a bug report on https://github.com/ros2/launch_ros/ with a complete description of your setup and a minimal repro.
Asked by hidmic on 2021-03-31 08:26:45 UTC
@hidmic Thanks, I'll take a look at Rolling and possibly file a bug report.
Asked by Jeffrey Kane Johnson on 2021-03-31 08:30:00 UTC