using 'setInternalGhostPairCallback' cause bullet to crash in multi thread mode
Posted: Mon Nov 22, 2021 7:08 am
I've tried using bullet in multi thread mode (using exactly the same initialize sequence suggest in the topic).
It work great with almost 2x performance boost.
but since my program required use of character controller and ghost object,I have to call setInternalGhostPairCallback.
this cause bullet to crash with access violation. in function
Remove the setInternalGhostPairCallback stop the crashed but make character fall throught the ground since it need ghost object.
The Bullet I am using is version 2.89 compile with BT_THREADSAFE.
Character controller used are the reference one included with the source of 2.89
It work great with almost 2x performance boost.
but since my program required use of character controller and ghost object,I have to call setInternalGhostPairCallback.
this cause bullet to crash with access violation. in function
Code: Select all
void btCollisionDispatcherMt::releaseManifold(btPersistentManifold* manifold)
{
clearManifold(manifold);
//btAssert( !btThreadsAreRunning() );
if (!m_batchUpdating)
{
// batch updater will update manifold pointers array after finishing, so
// only need to update array when not batch-updating
int findIndex = manifold->m_index1a;
btAssert(findIndex < m_manifoldsPtr.size());
m_manifoldsPtr.swap(findIndex, m_manifoldsPtr.size() - 1);
m_manifoldsPtr[findIndex]->m_index1a = findIndex;
m_manifoldsPtr.pop_back();
}
manifold->~btPersistentManifold();
if (m_persistentManifoldPoolAllocator->validPtr(manifold))
{
m_persistentManifoldPoolAllocator->freeMemory(manifold);
}
else
{
btAlignedFree(manifold);
}
The Bullet I am using is version 2.89 compile with BT_THREADSAFE.
Character controller used are the reference one included with the source of 2.89