Segmentation fault with a camnode subscriber
Hi !
I'm trying to convert an image from a Basler gigE camera to openCV to unwrap it but when I get a segmentation fault at runtime.
The subscriber ran once correctly before giving the segmentation fault the next day. Also arv-viewer and rviz cannot longer display the image.
The line causing the segmentation fault is :
cv_ptr = cv_bridge::toCvCopy(msg, "bgr8");
Debugging with gdb gave the following traceback:
(gdb) backtrace
#0 0x00007ffff5f579d6 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff724e8ca in cv::Mat::copyTo(cv::_OutputArray const&) const () from /opt/ros/fuerte/lib/libopencv_core.so.2.4
#2 0x00007ffff69071a4 in cv_bridge::toCvCopyImpl (source=..., src_header=..., src_encoding=..., dst_encoding=...)
at /tmp/buildd/ros-fuerte-vision-opencv-1.8.8/debian/ros-fuerte-vision-opencv/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/src/cv_bridge.cpp:219
#3 0x00007ffff6908c4a in cv_bridge::toCvCopy (source=..., encoding=...)
at /tmp/buildd/ros-fuerte-vision-opencv-1.8.8/debian/ros-fuerte-vision-opencv/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/src/cv_bridge.cpp:309
#4 0x00007ffff6909321 in cv_bridge::toCvCopy (source=..., encoding=...)
at /tmp/buildd/ros-fuerte-vision-opencv-1.8.8/debian/ros-fuerte-vision-opencv/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/src/cv_bridge.cpp:298
#5 0x00000000004035e7 in ImageConverter::imageCb (this=0x7fffffffdc30, msg=...)
at /home/rovit1/fuerte_workspace/sandbox/camera_aravis/src/cvConv.cpp:84
#6 0x00007ffff7bb5357 in operator() (a0=..., this=<optimised out>) at /usr/include/boost/function/function_template.hpp:1013
#7 image_transport::RawSubscriber::internalCallback(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, boost::function<void (boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&)> const&) (this=<optimised out>, message=..., user_cb=...)
at /tmp/buildd/ros-fuerte-image-common-1.8.0/debian/ros-fuerte-image-common/opt/ros/fuerte/stacks/image_common/image_transport/include/image_transport/raw_subscriber.h:27
#8 0x00007ffff7ba8fda in operator() (a0=..., this=<optimised out>) at /usr/include/boost/function/function_template.hpp:1013
#9 boost::detail::function::void_function_obj_invoker1<boost::function<void (boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&)>, void, boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> >::invoke(boost::detail::function::function_buffer&, boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const>) (function_obj_ptr=..., a0=...)
at /usr/include/boost/function/function_template.hpp:153
#10 0x00007ffff7bbbd24 in operator() (a0=<error reading variable: access outside bounds of object referenced via synthetic pointer>,
this=0x623598) at /usr/include/boost/function/function_template.hpp:1013
#11 ros::SubscriptionCallbackHelperT<boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, void>::call (this=0x623590,
params=...) at /opt/ros/fuerte/include/ros/subscription_callback_helper.h:180
#12 0x00007ffff78f71d7 in ros::SubscriptionQueue::call() () from /opt/ros/fuerte/lib/libroscpp.so
#13 0x00007ffff78a9c09 in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*) () from /opt/ros/fuerte/lib/libroscpp.so
#14 0x00007ffff78ab6ab in ros::CallbackQueue::callAvailable(ros::WallDuration) () from /opt/ros/fuerte/lib/libroscpp.so
#15 0x00007ffff78faa28 in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*) () from /opt/ros/fuerte/lib/libroscpp.so
#16 0x00007ffff78dfa2b in ros::spin() () from /opt/ros/fuerte/lib/libroscpp.so
#17 0x0000000000402aec in main (argc=1, argv=0x7fffffffde88) at /home/rovit1/fuerte_workspace/sandbox/camera_aravis/src/cvConv.cpp:177
Any idea on what might cause this error?
C.P.
Asked by ClementP on 2013-06-24 05:36:57 UTC
Comments