bulletphysics/bullet3

malloc(): invalid size (unsorted) when defining btDynamicsWorld object

BurntRanch opened this issue · 0 comments

When defining a btDynamicsWorld in an OpenGL program, it aborts and prints malloc(): invalid size (unsorted)

These are the relevant lines of code:

    btCollisionConfiguration *BULLET_COLLISION_CONFIG = new btDefaultCollisionConfiguration();
    btCollisionDispatcher *BULLET_COLLISION_DISPATCHER = new btCollisionDispatcher(WE_BULLET_COLLISION_CONFIG);
    btBroadphaseInterface *BULLET_OVERLAPPING_PAIR_CACHE = new btDbvtBroadphase();
    btConstraintSolver *BULLET_SOLVER = new btSequentialImpulseConstraintSolver();
    btDynamicsWorld *BULLET_WORLD = new btDiscreteDynamicsWorld(WE_BULLET_COLLISION_DISPATCHER, BULLET_OVERLAPPING_PAIR_CACHE, WE_BULLET_SOLVER, WE_BULLET_COLLISION_CONFIG);

Those are the first usages of bullet, incase there's a function I need to call first?

This is the stacktrace from GDB:

#1  0x00007ffff6e5a6c8 in raise () from /usr/lib/libc.so.6
#2  0x00007ffff6e424b8 in abort () from /usr/lib/libc.so.6
#3  0x00007ffff6e43395 in ?? () from /usr/lib/libc.so.6
#4  0x00007ffff6eb52a7 in ?? () from /usr/lib/libc.so.6
#5  0x00007ffff6eb85fc in ?? () from /usr/lib/libc.so.6 // crash
#6  0x00007ffff6eba901 in calloc () from /usr/lib/libc.so.6
#7  0x00007ffff73dddfc in btAlignedAllocDefault(unsigned long, int) () from /usr/lib/libLinearMath.so.3.25
#8  0x00007ffff7598636 in btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher*, btBroadphaseInterface*, btConstraintSolver*, btCollisionConfiguration*) () from /usr/lib/libBulletDynamics.so.3.25
#9  0x0000555555594634 in start () at engine.hpp
#10 0x0000555555598090 in main () at main.cpp

That's all I know, I will recompile bullet with debug flags soon.