I am getting a crash in a worker thread with these details:
* thread #3: tid = 14943, 0x00000000007c7f8b adust-magnum`dgBroadPhase::FindCollidingPairsGeneric(this=0x00000000028726c0, descriptor=0x00007fa312ff6d40, threadID=0) + 171 at dgBroadPhase.cpp:1260, name = 'adust-magnum', stop reason = invalid address (fault address: 0x7fa33ef6b168)
frame #0: 0x00000000007c7f8b adust-magnum`dgBroadPhase::FindCollidingPairsGeneric(this=0x00000000028726c0, descriptor=0x00007fa312ff6d40, threadID=0) + 171 at dgBroadPhase.cpp:1260
1257 dgVector timestep2 (descriptor->m_timestep * descriptor->m_timestep * dgFloat32 (4.0f));
1258 while ((index = dgAtomicExchangeAndAdd(&descriptor->m_pairsCount, -1)) > 0) {
1259 index --;
-> 1260 pool[0] = descriptor->m_pairs[index * 2];
1261 pool[1] = descriptor->m_pairs[index * 2 + 1];
1262
1263 dgInt32 stack = 2;
(lldb) bt
* thread #3: tid = 14943, 0x00000000007c7f8b adust-magnum`dgBroadPhase::FindCollidingPairsGeneric(this=0x00000000028726c0, descriptor=0x00007fa312ff6d40, threadID=0) + 171 at dgBroadPhase.cpp:1260, name = 'adust-magnum', stop reason = invalid address (fault address: 0x7fa33ef6b168)
* frame #0: 0x00000000007c7f8b adust-magnum`dgBroadPhase::FindCollidingPairsGeneric(this=0x00000000028726c0, descriptor=0x00007fa312ff6d40, threadID=0) + 171 at dgBroadPhase.cpp:1260
frame #1: 0x0000000002bf7440
frame #2: 0x00000000c1c10000
(lldb) frame variable *descriptor
(dgBroadphaseSyncDescriptor) *descriptor = {
m_lock = 0x0000000002bf5040
m_pairsCount = 46101567
m_pairsAtomicCounter = 0
m_jointsAtomicCounter = 46092928
m_timestep = 0
m_collindPairBodyNode = 0x0000000002bf7440
m_forceAndTorqueBodyNode = 0x0000000002bf54c0
m_sofBodyNode = 0x0000000002bf7440
m_broadPhaseType = 46094080
m_pairs = {
[0] = 0x0000000002bf7440
[1] = 0x0000000002bf5940
.....
I think I have tracked it down though... after a lot of debugging. I introduced a bug with a rewrite that meant all my objects piled up in exactly the same spot. Might be good to issue some sensible kind of warning for this case.
Thanks for all your work.