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

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

Open
BurntRanch opened this issue Feb 24, 2024 · 0 comments
Open

Comments

@BurntRanch
Copy link

BurntRanch commented Feb 24, 2024

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.

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