C++ compilation issues on TX1

Hi everyone,

Looking for some help with a compilation issue that pops up on a fresh install of Jetpack 2.1 on a TX1. I am trying to compile a bunch of c++ code that has been working fine on our TK1 platforms. On the TX1, however, I am getting the following error:

*** Error in '/usr/bin/c++': double free or corruption (top): 0x000a69e8 ***

I tried to compile with gcc-4.9 so I could use the -mtune=cortex-a57 flag (wasn’t working with the gcc-4.8 version that came with the JetPack), but it still gives the same error. I am also using the -march=armv8-a flag…

Anyone have any ideas what could be the reason for this or how to resolve the problem? I have never seen this kind of error before…

Thanks a lot in advance …

best,
Marc

Knowing how to reproduce the error is probably required, e.g., the simplest test case if there is some example source code available.

I was trying to compile the following package: GitHub - uzh-rpg/rpg_vikit: Vision-Kit provides some tools for your vision/robotics project. and the errors I was getting always first come up on the following files: vikit_common/src/atan_camera.cpp and vikit_common/src/omni_camera.cpp

More complete command line output:

Building CXX object rpg_vikit/vikit_common/CMakeFiles/vikit_common.dir/src/atan_camera.cpp.o
*** Error in `/usr/bin/c++': double free or corruption (top): 0x000a69e8 ***
Aborted
make[2]: *** [rpg_vikit/vikit_common/CMakeFiles/vikit_common.dir/src/atan_camera.cpp.o] Error 134
make[2]: *** Waiting for unfinished jobs....
[ 22%] [ 25%] Built target cv_bridge
[ 33%] Built target ifm_core_generate_messages_cpp
Building CXX object rpg_vikit/vikit_common/CMakeFiles/vikit_common.dir/src/omni_camera.cpp.o
*** Error in `/usr/bin/c++': double free or corruption (top): 0x000a69e8 ***
Aborted
make[2]: *** [rpg_vikit/vikit_common/CMakeFiles/vikit_common.dir/src/omni_camera.cpp.o] Error 134
make[1]: *** [rpg_vikit/vikit_common/CMakeFiles/vikit_common.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Any ideas?

Thanks,
Marc

What was the exact command line you used which gave the error? Were there any packages you installed first to make this work?

Hello MarcGy

I had identical issues with GitHub - raulmur/ORB_SLAM2: Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities

For me editing ALL the CMake files (there were dependencies) with the following did the trick. Although I did note that you mentioned you had this already… Might be worth checking it is getting handled correctly. Not sure if the CXX11 is related.

-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  -Wall  -O3 -march=native ")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall   -O3 -march=native")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  -Wall  -O3 -march=armv8-a ")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall   -O3 -march=armv8-a")

+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

Hello,

I had the same error on rpg_vikit and as suggested by RMZNobody, editing the CMakeList.txt files worked.
However, the only edit I had to make was to replace “native” by “armv8-a”. No need for c++11 on my side.

Changing the compile flag to armv8-a fixed it. Just out of curiosity: anyone have an idea why it didn’t work with the cortex-a57 compiler flag?

Thanks