Error "malloc.c:2394: sysmalloc: Assertion " when compiling HelloWorld example

Post Reply
nicholishiell
Posts: 1
Joined: Sat Oct 13, 2018 7:00 pm

Error "malloc.c:2394: sysmalloc: Assertion " when compiling HelloWorld example

Post by nicholishiell »

Hello all,
I am trying to build the HelloWorld example from the bullet3 examples with my own script. The examples compiles however I get the following error when I try to run the binary:
malloc.c:2394: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted (core dumped)
I found the exact same issue was posted awhile back (viewtopic.php?f=9&t=11129&p=37377&hilit=malloc#p37377) in which the poster suggested compiling the bullet library with a different compiler version. By default I was compiling with g++/gcc 5.4 so I switched too g++/gcc 4.8. However I am still getting the same error.

In order to change the compiler version I added the following lines to the CMakeLists.txt in the main build directory

Code: Select all

SET(CMAKE_C_COMPILER /usr/bin/gcc-4.8 )
SET(CMAKE_CXX_COMPILER /usr/bin/g++-4.8 )
I wrote my own little script to find all the required dependencies for the HelloWorld example

Code: Select all

export BULLET_INCLUDES=/home/nicholishiell/workspace/bullet3/src
export BULLET_LIBRARIES_DIR=/home/nicholishiell/workspace/bullet3/build_cmake/src
export BULLET_LIB_COLLISION_DIR=$BULLET_LIBRARIES_DIR/BulletCollision
export BULLET_LIB_LINEARMATH_DIR=$BULLET_LIBRARIES_DIR/LinearMath
export BULLET_LIB_DYNAMICS_DIR=$BULLET_LIBRARIES_DIR/BulletDynamics

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${BULLET_LIB_COLLISION_DIR}:${BULLET_LIB_COLLISION_DIR}:${BULLET_LIB_LINEARMATH_DIR}:${BULLET_LIB_DYNAMICS_DIR}:/usr/local/lib

g++-4.8  HelloWorld.cpp -lGL -lGLU \
    -L $BULLET_LIB_COLLISION_DIR -lBulletCollision \
    -L $BULLET_LIB_DYNAMICS_DIR -lBulletDynamics \
    -L $BULLET_LIB_LINEARMATH_DIR -lLinearMath \
    -I $BULLET_INCLUDES 
I am running Ubuntu 16.04.5 LTS on a Acer Nitro5 laptop with an NVIDIA® GeForce® GTX 1050 video card.

It should also be noted that all the examples compile and run with out issue in the build_cmake directory.

Thanks in advance for the help!

Nicholi.
Post Reply