SIGSEGV in waitForTimeTransform in docker
I am facing a strange SIGSEGV error inside the TF module, when used in a docker container.
In short:
the method tf::Transformer::waitForTransform(...)
causes a segmentation fault!
See this repository to reproduce the error quickly: https://github.com/mojovski/tf_docker...
In long:
The waitForTransform
in these lines causes the crash:
std::string global_frame="map";
std::string robot_frame="base_link";
try{
ROS_INFO_STREAM("timenow: " << ros::Time::now().toSec());
bool res=listener.waitForTransform(global_frame, robot_frame,
ros::Time::now(), ros::Duration(0.1), ros::Duration(0.1),
&err_msg);
}
catch (tf::TransformException ex){
ROS_ERROR("%s",ex.what());
}
Strangely, it runs on my Ubuntu 16.04 machine. But when I also use Ubuntu16.04 inside docker, this crashes.
If you do the steps in the readme here https://github.com/mojovski/tf_docker... , you will get this stack trace:
Thread 1 "test179" received signal SIGSEGV, Segmentation fault.
0x00007ffff73bddda in ros::TimeBase<ros::Time, ros::Duration>::operator+(ros::Duration const&) const () from /opt/ros/kinetic/lib/librostime.so
(gdb) bt
#0 0x00007ffff73bddda in ros::TimeBase<ros::Time, ros::Duration>::operator+(ros::Duration const&) const () from /opt/ros/kinetic/lib/librostime.so
#1 0x00007ffff65d6013 in tf2_ros::Buffer::canTransform(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::Time const&, ros::Duration, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const () from /opt/ros/kinetic/lib/libtf2_ros.so
#2 0x00007ffff7bb6a3f in tf::Transformer::waitForTransform(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::Time const&, ros::Duration const&, ros::Duration const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const ()
from /opt/ros/kinetic/lib/libtf.so
#3 0x000000000040a8ac in main (argc=1, argv=0x7fffffffe448) at /root/catkin_ws/src/test179/src/test_bug179.cpp:31
After some days of looking for a reason, I hope now that someone can help me with that.
Thanks a lot in advance!
PS: I Also created an issue about this here: https://github.com/ros/geometry/issue...
Seeing
ros::Time
mentioned here: did you update all ROS packages in the Docker container? In yourDockerfile
I only see it installing a few additional pkgs after starting fromros:kinetic
.There has been a recent ABI breakage, so it might be that the
ros:kinetic
image you're using .... still has the state from before the breakage, necessitating a full update of all ROS pkgs in order to avoid
SEGFAULT
s.See also #q303093.