When roslaunching gazebo repeatedly, the gazebo process sometimes hangs on shutdown (about 1 in 40 times). I've taken a backtrace from just before roslaunch escalates to SIGTERM, and hopefully identified the stalled thread.
{{{
Thread 20 (Thread 0x7f16b3b90910 (LWP 6688)):
0 0x00007f16f8474f51 in nanosleep () from /lib/libc.so.6
1 0x00007f16f84a9bb4 in usleep () from /lib/libc.so.6
---Type to continue, or q to quit---
2 0x00007f16d2f8f902 in pr2_controller_manager::ControllerManager::unloadController(std::string const&) ()
from /u/sglaser/ros/dev/pr2_mechanism/pr2_controller_manager/lib/libpr2_controller_manager.so
3 0x00007f16d2f90298 in pr2_controller_manager::ControllerManager::unloadControllerSrv(pr2_mechanism_msgs::UnloadControllerRequest_std::allocator&, pr2_mechanism_msgs::UnloadControllerResponse_std::allocator&) ()
}}}
Here, the controller manager is waiting for the realtime process to make use of the new controller list, but the realtime process is no longer running (as it has been shutdown already).
When roslaunching gazebo repeatedly, the gazebo process sometimes hangs on shutdown (about 1 in 40 times). I've taken a backtrace from just before roslaunch escalates to SIGTERM, and hopefully identified the stalled thread.
{{{ Thread 20 (Thread 0x7f16b3b90910 (LWP 6688)):
0 0x00007f16f8474f51 in nanosleep () from /lib/libc.so.6
1 0x00007f16f84a9bb4 in usleep () from /lib/libc.so.6
---Type to continue, or q to quit---
2 0x00007f16d2f8f902 in pr2_controller_manager::ControllerManager::unloadController(std::string const&) ()
from /u/sglaser/ros/dev/pr2_mechanism/pr2_controller_manager/lib/libpr2_controller_manager.so
3 0x00007f16d2f90298 in pr2_controller_manager::ControllerManager::unloadControllerSrv(pr2_mechanism_msgs::UnloadControllerRequest_std::allocator&, pr2_mechanism_msgs::UnloadControllerResponse_std::allocator&) ()
}}}
Here, the controller manager is waiting for the realtime process to make use of the new controller list, but the realtime process is no longer running (as it has been shutdown already).
trac data: