Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what(): __gnu_cxx::__concurrence_lock_error #97

Open
MathewRo opened this issue Jun 11, 2019 · 0 comments
Open

what(): __gnu_cxx::__concurrence_lock_error #97

MathewRo opened this issue Jun 11, 2019 · 0 comments

Comments

@MathewRo
Copy link

MathewRo commented Jun 11, 2019

I'm trying to cross compile a QT based application that depends on a few libraries -

vsomeIP
CommonAPI
CommonAPI-SomeIP

These libraries are cmake based and depends on boost. I Initially downloaded boost by apt-get and mounted my PI rootfs at /mnt as /mnt/rpi_rootfs. This however had problems when I tried to link them to the application as the toolchain had a different gcc version from that used to compile boost. I downloaded boost source and cross compiled it with the toolchain. I compiled the above libs by linking boost. I could also compile my QT application. At runtime however, I'm now getting this strange error -

20:37:24: Starting /home/pi/InfotainmentCluster/bin/InfotainmentCluster...
QML debugging is enabled. Only use this in a safe environment.
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
FT_New_Face failed with index 0 : 1
libpng warning: bKGD: invalid
2018-07-24 12:29:09.568359 [info] Parsed vsomeip configuration in 0ms
2018-07-24 12:29:09.569341 [info] Default configuration module loaded.
2018-07-24 12:29:09.569465 [info] Initializing vsomeip application "".
2018-07-24 12:29:09.569945 [warning] Routing Manager seems to be inactive. Taking over...
2018-07-24 12:29:09.570410 [warning] unlink failed for /tmp/vsomeip-f. Client identifier 0xf can't be reused!
2018-07-24 12:29:09.570477 [warning] unlink failed for /tmp/vsomeip-10. Client identifier 0x10 can't be reused!
2018-07-24 12:29:09.570534 [warning] unlink failed for /tmp/vsomeip-11. Client identifier 0x11 can't be reused!
2018-07-24 12:29:09.570603 [warning] unlink failed for /tmp/vsomeip-13. Client identifier 0x13 can't be reused!
2018-07-24 12:29:09.570742 [warning] unlink failed for /tmp/vsomeip-1b. Client identifier 0x1b can't be reused!
2018-07-24 12:29:09.570812 [warning] unlink failed for /tmp/vsomeip-1d. Client identifier 0x1d can't be reused!
2018-07-24 12:29:09.570946 [info] SOME/IP client identifier configured. Using 002f (was: 0000)
2018-07-24 12:29:09.571064 [info] No routing manager configured. Using auto-configuration.
2018-07-24 12:29:09.571099 [info] Instantiating routing manager [Host].
2018-07-24 12:29:09.571397 [error] routing_manager_stub::init_endpoint unlink failed (/tmp/vsomeip-0): Operation not permitted
2018-07-24 12:29:09.571761 [info] init_routing_endpoint Routing endpoint at /tmp/vsomeip-0
2018-07-24 12:29:09.572781 [error] Server endpoint creation failed (3)
2018-07-24 12:29:09.572847 [error] routing_manager_stub::init_routing_endpoint Client ID: 0: acceptor bind: Address already in use
2018-07-24 12:29:09.573129 [info] Client [2f] is connecting to [0] at /tmp/vsomeip-0
2018-07-24 12:29:09.573225 [info] Service Discovery enabled. Trying to load module.
2018-07-24 12:29:09.575122 [info] Service Discovery module loaded.
2018-07-24 12:29:09.575757 [info] Application(unnamed, 2f) is initialized (11, 100).
2018-07-24 12:29:09.576370 [info] Starting vsomeip application "" using 2 threads
2018-07-24 12:29:09.576546 [info] REGISTER EVENT(002f): [0040.5676.84d0:is_provider=false]
2018-07-24 12:29:09.576722 [info] REQUEST(002f): [0040.5676:1.4294967295]
2018-07-24 12:29:09.576846 [info] shutdown thread id from application: 002f () is: 6daff440 TID: 19554
2018-07-24 12:29:09.576933 [info] main dispatch thread id from application: 002f () is: 6e2ff440 TID: 19553
2018-07-24 12:29:09.577210 [error] routing_manager_stub::init_endpoint unlink failed (/tmp/vsomeip-0): Operation not permitted
2018-07-24 12:29:09.577339 [info] init_routing_endpoint Routing endpoint at /tmp/vsomeip-0
2018-07-24 12:29:09.577613 [error] Server endpoint creation failed (3)
2018-07-24 12:29:09.577672 [error] routing_manager_stub::init_routing_endpoint Client ID: 0: acceptor bind: Address already in use
terminate called after throwing an instance of '__gnu_cxx::__concurrence_lock_error'
  what():  __gnu_cxx::__concurrence_lock_error
2018-07-24 12:29:09.577882 [info] Watchdog is disabled!
20:37:26: Process killed by signal

I couldn't find much help elsewhere for this particular issue. I'm cross compiling the above 3 library using a toolchain file

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

include(CMakeForceCompiler)
set (tools /home/i18350/toolchain/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin)
set(CMAKE_C_COMPILER ${tools}/arm-linux-gnueabihf-gcc-4.8.3)
set(CMAKE_CXX_COMPILER ${tools}/arm-linux-gnueabihf-g++)
set(CMAKE_AR ${tools}/arm-linux-gnueabihf-ar)
set(CMAKE_LD ${tools}/arm-linux-gnueabihf-ld)
# here is the target environment located
set(CMAKE_FIND_ROOT_PATH /mnt/rpi_rootfs) 
set(CMAKE_SYSROOT /mnt/rpi_rootfs)

set(Boost_INCLUDE_DIR /home/i18350/appsteam/linux/boost_1_62_0/)
set(boost_library_dir /home/i18350/appsteam/linux/boost_1_62_0/stage/lib)
set(Boost_LIBRARY_DIR /home/i18350/appsteam/linux/boost_1_62_0/stage/lib)
set(CommonAPI_DIR /home/i18350/appsteam/linux/libraries/common-api/capicxx-core-runtime/build)
set(vsomeip_DIR /home/i18350/appsteam/linux/libraries/common-api/vsomeip/build)

set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(_GLIBCXX_USE_CXX11_ABI 0)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

Since the default CMakeList.txt uses find_package for finding boost, I'm overriding them from the toolchain file using my custom boost include and lib path. Can someone please shed some light into what I'm doing wrong ??

My target uses a stretch with gcc/g++ 6.3.0. My host is Ubuntu16-04.
This is the ldd result on my QT application

	linux-vdso.so.1 (0x7ee7e000)
	/usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76fa0000)
	libCommonAPI.so.3.1.12 => /usr/QTlibs/libCommonAPI.so.3.1.12 (0x76f7d000)
	libCommonAPI-SomeIP.so.3.1.12 => /usr/QTlibs/libCommonAPI-SomeIP.so.3.1.12 (0x76ef3000)
	libvsomeip.so.2 => /usr/QTlibs/libvsomeip.so.2 (0x76d92000)
	libboost_log.so.1.62.0 => /usr/QTlibs/libboost_log.so.1.62.0 (0x76cf0000)
	libboost_system.so.1.62.0 => /usr/QTlibs/libboost_system.so.1.62.0 (0x76fd7000)
	libboost_thread.so.1.62.0 => /usr/QTlibs/libboost_thread.so.1.62.0 (0x76ccd000)
	libboost_filesystem.so.1.62.0 => /usr/QTlibs/libboost_filesystem.so.1.62.0 (0x76cb0000)
	libboost_regex.so.1.62.0 => /usr/QTlibs/libboost_regex.so.1.62.0 (0x76bdf000)
	libboost_date_time.so.1.62.0 => /usr/QTlibs/libboost_date_time.so.1.62.0 (0x76bc9000)
	libboost_chrono.so.1.62.0 => /usr/QTlibs/libboost_chrono.so.1.62.0 (0x76bbb000)
	libQt5Quick.so.5 => /usr/local/qt5pi/lib/libQt5Quick.so.5 (0x76803000)
	libQt5Gui.so.5 => /usr/local/qt5pi/lib/libQt5Gui.so.5 (0x7632d000)
	libQt5Qml.so.5 => /usr/local/qt5pi/lib/libQt5Qml.so.5 (0x75f5c000)
	libQt5Network.so.5 => /usr/local/qt5pi/lib/libQt5Network.so.5 (0x75e27000)
	libQt5Core.so.5 => /usr/local/qt5pi/lib/libQt5Core.so.5 (0x75894000)
	libbrcmGLESv2.so => /opt/vc/lib/libbrcmGLESv2.so (0x75856000)
	libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x7582d000)
	libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x756e5000)
	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x75666000)
	libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x75639000)
	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x754fa000)
	/lib/ld-linux-armhf.so.3 (0x76fb6000)
	libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x754e5000)
	librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x754ce000)
	libboost_atomic.so.1.62.0 => /usr/QTlibs/libboost_atomic.so.1.62.0 (0x754c3000)
	libgthread-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0x754b1000)
	libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0x753a9000)
	libbrcmEGL.so => /opt/vc/lib/libbrcmEGL.so (0x75370000)
	libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x75349000)
	libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0x75333000)
	libvcos.so => /opt/vc/lib/libvcos.so (0x75319000)
	libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0x7529e000)

I have set the rpath to /usr/QTLibs. However I can see that libstdc++.so is the one that is coming with the system. I believe this is not the one that the application used for linking (not sure) as the toolchain also provides a libstdc++.so and libc.so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant