[ros2] Calling std::terminate in a composed node?

asked 2021-03-30 07:59:15 -0500

updated 2021-03-30 08:00:11 -0500

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?

edit retag flag offensive close merge delete


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.

hidmic gravatar image hidmic  ( 2021-03-31 08:26:45 -0500 )edit

@hidmic Thanks, I'll take a look at Rolling and possibly file a bug report.

Jeffrey Kane Johnson gravatar image Jeffrey Kane Johnson  ( 2021-03-31 08:30:00 -0500 )edit