ros-drivers / pointgrey_camera_driver

ROS driver for Pt. Grey cameras, based on the official FlyCapture2 SDK.
128 stars 180 forks source link

Segfault in onInit() with other nodelets in same manager #157

Open zlacelle opened 6 years ago

zlacelle commented 6 years ago

Running the newest version of the repo after commit ae5da34fabf33b25613a691b980036163d6880e5 on October 27, 2017. Ubuntu 14.04 with kernel 4.4.0-101-generic, ROS indigo.

When running pointgrey_camera_driver as a nodelet with other nodelets from the image_proc stack, there is some race condition that causes pointgrey_camera_driver to segfault. This happens sporadically, not consistently. The nodelet's I'm running it with are image_proc/debayer and image_proc/rectify. This is on a Bumblebee2, if that helps.

Here's the stacktrace: (gdb) bt

0 strlen () at ../sysdeps/x86_64/strlen.S:106

1 0x00007ffff6722d75 in std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6

2 0x00007fffc4204974 in pointgrey_camera_driver::PointGreyStereoCameraNodelet::onInit (this=0x916ad0)

at /home/administrator/catkin_ws/src/pointgrey_camera_driver/pointgrey_camera_driver/src/stereo_nodelet.cpp:214

3 0x00007ffff7ba992b in nodelet::Nodelet::init(std::string const&, std::map<std::string, std::string, std::less, std::allocator<std::pair<std::string const, std::string> > > const&, std::vector<std::string, std::allocator > const&, ros::CallbackQueueInterface, ros::CallbackQueueInterface) ()

from /opt/ros/indigo/lib/libnodeletlib.so

4 0x00007ffff7bab30b in nodelet::Loader::load(std::string const&, std::string const&, std::map<std::string, std::string, std::less, std::allocator<std::pair<std::string const, std::string> > > const&, std::vector<std::string, std::allocator > const&) () from /opt/ros/indigo/lib/libnodeletlib.so

5 0x00007ffff7bba4d2 in nodelet::LoaderROS::serviceLoad(nodelet::NodeletLoadRequest<std::allocator >&, nodelet::NodeletLoadResponse<std::allocator >&) () from /opt/ros/indigo/lib/libnodeletlib.so

6 0x00007ffff7bbf0a4 in ros::ServiceCallbackHelperT<ros::ServiceSpec<nodelet::NodeletLoadRequest<std::allocator >, nodelet::NodeletLoadResponse<std::allocator > > >::call(ros::ServiceCallbackHelperCallParams&)

() from /opt/ros/indigo/lib/libnodeletlib.so

7 0x00007ffff7470a8a in ros::ServiceCallback::call() () from /opt/ros/indigo/lib/libroscpp.so

8 0x00007ffff74b3107 in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*) ()

from /opt/ros/indigo/lib/libroscpp.so

9 0x00007ffff74b3c53 in ros::CallbackQueue::callAvailable(ros::WallDuration) ()

from /opt/ros/indigo/lib/libroscpp.so

10 0x00007ffff74fc175 in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*) ()

from /opt/ros/indigo/lib/libroscpp.so

11 0x00007ffff74e3d9b in ros::spin() () from /opt/ros/indigo/lib/libroscpp.so

12 0x000000000040494e in main ()

Line in question: (gdb) up

2 0x00007fffc4204974 in pointgrey_camera_driver::PointGreyStereoCameraNodelet::onInit (this=0x916ad0)

at /home/administrator/catkin_ws/src/pointgrey_camera_driver/pointgrey_camera_driver/src/stereo_nodelet.cpp:214

214 updater_.setHardwareID("pointgrey_camera " + serial); (gdb) p serial $1 = 8511553

I've attached the stdout from the launch attempt as well.

Launching as a standalone nodelet inside of its own manager works 100% of the time. nodelet_crash.txt