Crash in processCollision for convex hulls? (Scrap Mechanic)

Post Reply
pontus.h
Posts: 3
Joined: Mon Mar 19, 2012 2:44 pm

Crash in processCollision for convex hulls? (Scrap Mechanic)

Post by pontus.h »

Hi!
I need some advice on what could be causing this crash for me.
I have not been able to reproduce this myself but i have 4000~ crash reports with this call stack in bugsplat:

Code: Select all

ScrapMechanic!_maxdot_large                                                  d:/deps/bullet3/src/linearmath/btvector3.cpp(425)
ScrapMechanic!convexHullSupport                                              d:/deps/bullet3/src/bulletcollision/collisionshapes/btconvexshape.cpp(122)
ScrapMechanic!btConvexShape::localGetSupportVertexWithoutMarginNonVirtual    d:/deps/bullet3/src/bulletcollision/collisionshapes/btconvexshape.cpp(292)
ScrapMechanic!btGjkPairDetector::getClosestPointsNonVirtual                  d:/deps/bullet3/src/bulletcollision/narrowphasecollision/btgjkpairdetector.cpp(142)
ScrapMechanic!btGjkPairDetector::getClosestPoints                            d:/deps/bullet3/src/bulletcollision/narrowphasecollision/btgjkpairdetector.cpp(78)
ScrapMechanic!btConvexConvexAlgorithm::processCollision                      d:/deps/bullet3/src/bulletcollision/collisiondispatch/btconvexconvexalgorithm.cpp(592)
ScrapMechanic!btCompoundCompoundLeafCallback::Process                        d:/deps/bullet3/src/bulletcollision/collisiondispatch/btcompoundcompoundcollisionalgorithm.cpp(207)
ScrapMechanic!MycollideTT                                                    d:/deps/bullet3/src/bulletcollision/collisiondispatch/btcompoundcompoundcollisionalgorithm.cpp(277)
ScrapMechanic!btCompoundCompoundCollisionAlgorithm::processCollision         d:/deps/bullet3/src/bulletcollision/collisiondispatch/btcompoundcompoundcollisionalgorithm.cpp(354)
ScrapMechanic!btCollisionDispatcher::defaultNearCallback                     d:/deps/bullet3/src/bulletcollision/collisiondispatch/btcollisiondispatcher.cpp(301)
...
The line that is crashing is:

Code: Select all

for( index = 0; 0 == (test=_mm_movemask_ps( _mm_cmpeq_ps( stack_array[index], max))); index++ )   // local_count must be a multiple of 4
Since it is a SIMD thing, my guess is that some data is unaligned in a convex hull or something.
I have seen some people talking about problems with specific hulls.
https://code.google.com/archive/p/bullet/issues/657

I have some convex hull shapes that are completely flat with a margin. Could this be an issue?

The game is on windows.

Grateful for help! :)
/Pontus


Edit:
I got a save file from one of the users with a crash on start so I can finally debug this.
So far i have figured out that one of the colliding objects are a always a character controller (btActionInterface with a btPairCachingGhostObject).
The transform for the other object becomes all -1.#QNAN000 values.
Xammond
Posts: 15
Joined: Sun Jan 03, 2016 4:22 pm

Re: Crash in processCollision for convex hulls? (Scrap Mecha

Post by Xammond »

I notice in btVector3.cpp (Ln 60) that maxIndex defaults to -1L, you could try defaulting it to 0 to avoid the case of -1 ever being returned. Apart from that, good luck reproducing the crash! Hey your game looks awesome, adding to wishlist :)
Post Reply