Segmentation Fault in /usr/lib/arm-linux-gnueabihf/libQtGui.so.4 when using ROS packages cv_bridge and image_transport on Raspberry PI 3

3

I face problems when running example ROS code on Raspberry PI 3 when adding dependencies cv_bridge and image_transport to my own package. I took the code from the example publisher and subscriber tutorial which can be found in Writing a Simple Publisher and Subscriber (C++).

Since I want to grab images and send them to another node, I use cv_bridge and image_transport. I only adapted the package.xml and CMakeLists.txt. The C++ code is left unchanged.

When starting image_talker on the Raspberry PI 3 the program stopps with segmentation fault. When I run the same code on a Desktop PC it runs flawlessly. The Desktop PC runs Ubuntu 16 LTS with ROS Kinetic installed from the official ROS repositories.

The backtrace from gdb is given below.

(gdb) r Starting program: /home/pi/my_workspace
/devel/lib/image_beginner_tutorials/image_talker
[Thread debugging using libthread_db enabled] 
Using host libthread_db library "/lib/arm-linux-
gnueabihf/libthread_db.so.1". 
Cannot access memory at address 0x0
Program received signal SIGILL, Illegal instruction. 
0x6b57ede8 in ?? () from /usr/lib/arm-linux-
gnueabihf/libcrypto.so.1.0.0 
(gdb) c Continuing. 
Cannot access memory at address 0x0
Program received signal SIGSEGV, Segmentation fault.
0x6c966678 in ?? () from /usr/lib/arm-linux-
gnueabihf/libQtGui.so.4 
(gdb) bt
#0 0x6c966678 in ?? () from /usr/lib/arm-linux-
gnueabihf/libQtGui.so.4
#1 0x76fdeffc in call_init (l=<optimized out="">, 
argc=1, argv=0x7efff044, env=0x7efff04c) at dl-init.c:78
#2 0x0000021c in ?? () Backtrace stopped: previous 
frame identical to this frame (corrupt stack?)

According to some googling, it seems like libopenssl intentionally fires SIGILL. After continuing the program execution, it stops with a segmentation fault.

The system I use is Raspbian Jessi with a customly built ROS Kinetic. Building ROS was done according to Installing ROS Kinetic on the Raspberry Pi.

Update

After digging deeper into the problem, it seems like the executables link for some reason against two different versions of Qt. It seems like ROS Kinetic makes use of a mixture of Qt5 and Qt4 libraries, according to ROS Kinetic Migration Guide. This causes problems on certain sytems like on the Raspberry PI 3 with Rasbpian Jessi as it seems.

The ldd output is given below.

ldd image_talker  | grep Qt
    libQt5Widgets.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so.5 (0x7402f000)
    libQt5Test.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Test.so.5 (0x73ff9000)
    libQt5Concurrent.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Concurrent.so.5 (0x73fe4000)
    libQt5Gui.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5 (0x73c14000)
    libQt5Core.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5 (0x7378f000)
    libQtGui.so.4 => /usr/lib/arm-linux-gnueabihf/libQtGui.so.4 (0x6c533000)
    libQtCore.so.4 => /usr/lib/arm-linux-gnueabihf/libQtCore.so.4 (0x6c292000)

I tried out some of the hints given in the ROS Kinetic Migration Guide, but they did not solve the problem. I tried to use only parts of OpenCV, namely core, in CMakeLists.txt. Setting up a ROS Kinetic variant which has no GUI dependencies is also not possible, since cv_bridge and image_transport are not shipped then.

c++
raspberry-pi
raspbian
ros
asked on Stack Overflow Jun 27, 2017 by stackjo • edited Jun 29, 2017 by stackjo

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0