ethz-asl / uvc_ros_driver

A ros node to stream images from a multi-camera UVC device
0 stars 3 forks source link

Crash when using cv::split #3

Closed marco-tranzatto closed 4 years ago

marco-tranzatto commented 6 years ago

After a few seconds the driver is started it crashes. This is the outpt of "where" when launched with gdb. @ZacharyTaylor any idea/suggestion?

Thread 8 "uvc_rosdriver" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffd2ffe700 (LWP 22508)] 0x00007ffff2387fa9 in cv::hal::split8u(unsigned char const*, unsigned char**, int, int) () from /opt/ros/kinetic/lib/libopencv_core3.so.3.2 (gdb) where

0 0x00007ffff2387fa9 in cv::hal::split8u(unsigned char const*, unsigned char**, int, int) () from /opt/ros/kinetic/lib/libopencv_core3.so.3.2

1 0x00007ffff2465b50 in cv::split(cv::Mat const&, cv::Mat*) () from /opt/ros/kinetic/lib/libopencv_core3.so.3.2

2 0x00007ffff6455800 in uvc::uvcROSDriver::extractImages(uvc_frame, bool, cv::Mat) ()

from /home/marco/uvc_ws/devel/.private/uvc_ros_driver/lib/libuvc_ros_driver.so

3 0x00007ffff645b998 in uvc::uvcROSDriver::uvc_cb(uvc_frame*) () from /home/marco/uvc_ws/devel/.private/uvc_ros_driver/lib/libuvc_ros_driver.so

4 0x00007ffff1c66c74 in _uvc_user_caller () from /usr/local/lib/x86_64-linux-gnu/libuvc.so.0

5 0x00007ffff66a36ba in start_thread (arg=0x7fffd2ffe700) at pthread_create.c:333

6 0x00007ffff5bdf41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

ZacharyTaylor commented 6 years ago

Hi Marco,

Sorry for the delay at looking at this. I had a quick look through the code just now but couldn't spot anything that looked particularly problematic. Is it doing this every time for you or just now and again?

marco-tranzatto commented 6 years ago

Hi @ZacharyTaylor the commit that introduces the error is 307dbcd Do you have any clue why?

Update: output gdb:

Thread 8 "uvc_rosdriver" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffd57fc700 (LWP 17292)] 0x00007ffff2425629 in cv::hal::split8u(unsigned char const*, unsigned char**, int, int) () from /opt/ros/kinetic/lib/libopencv_core3.so.3.3 (gdb) where

0 0x00007ffff2425629 in cv::hal::split8u(unsigned char const*, unsigned char**, int, int) () from /opt/ros/kinetic/lib/libopencv_core3.so.3.3

1 0x00007ffff23f1266 in cv::split(cv::Mat const&, cv::Mat*) () from /opt/ros/kinetic/lib/libopencv_core3.so.3.3

2 0x00007ffff63b748b in uvc::uvcROSDriver::extractImages (this=0x7fffffffbfe0, frame=0x9c3030, is_raw_images=false, images=0x7fffd57fb880)

at /home/marco/uvc_ws/src/uvc_ros_driver/src/uvc_ros_driver.cpp:815

3 0x00007ffff63b86a2 in uvc::uvcROSDriver::uvc_cb (this=0x7fffffffbfe0, frame=0x9c3030) at /home/marco/uvc_ws/src/uvc_ros_driver/src/uvc_ros_driver.cpp:1004

4 0x00007ffff63af31e in uvc::callback (frame=0x9c3030, arg=0x7fffffffbfe0) at /home/marco/uvc_ws/src/uvc_ros_driver/src/uvc_ros_driver.cpp:54

5 0x00007ffff1af9c74 in _uvc_user_caller () from /usr/local/lib/x86_64-linux-gnu/libuvc.so.0

6 0x00007ffff66926ba in start_thread (arg=0x7fffd57fc700) at pthread_create.c:333

7 0x00007ffff5a1f41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

(gdb)

ZacharyTaylor commented 6 years ago

That seems quite weird ,I guess I must be manipulating unallocated memory if a change in a unrelated part of the code is messing with it, I will try running things through valgrind and see if anything pops up

marco-tranzatto commented 6 years ago

Thanks! Let me know if I can help somehow. FYI: I'm running the device without a calibration file, probably this is the main difference with respect to your setup.

[ WARN] [1523875658.183782387]: Continuing without calibration file

ZacharyTaylor commented 6 years ago

This is probably the error, I will have to dig into where we depend on it, for now just give this calibration https://github.com/ethz-asl/mav_tools/blob/master/mav_startup/parameters/mavs/loon/calibration.yaml until you have your own

marco-tranzatto commented 6 years ago

Hi Zac, thanks for the workaround! ;)