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

I run into problems with the ROS code example running on Raspberry PI 3 when I add the cv_bridge and image_transport dependencies to my own package. I took the code from the Publisher and Subscriber Tutorial example, which can be found in Writing a Simple Publisher and Subscriber (C ++) .

Since I want to capture images and send them to another node, I am using cv_bridge and image_transport. I only adapted package.xml and CMakeLists.txt. The C ++ code remains unchanged .

When running image_talker on Raspberry PI 3, the program stops with a segmentation fault. When I run the same code on my desktop PC, it works flawlessly . The desktop PC runs Ubuntu 16 LTS with ROS Kinetic installed from the official ROS repositories.

The return path from gdb is shown 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 libopenssl

to work on purpose SIGILL

. After the program continues, it stops with a segmentation fault.

The system I'm using is a Raspbian Jessi with a custom built ROS Kinetic. The ROS building was done according to Installing ROS Kinetic on a Raspberry Pi .

Update

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

The ldd output is shown 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 some of the tips given in the ROS Kinetic Migration Guide , but they didn't solve the problem. I tried to use only parts of OpenCV, namely core

in CMakeLists.txt

. Setting up a ROS Kinetic variant that has no graphical dependencies is also not possible, as the cv_bridge and image_transport are not sent then.

+3


source to share





All Articles