[UE-57969] PhysX3CommonPROFILE_x64!physx::Gu::Facet::silhouette() Crash

Hey UE4 Development Team,

It appears that the crash described in UE-57969 is still occurring in the most recent version of UE4.21. I’ve sent out a couple dozen copies of our game to playtesters and while very rare, several of them have now crashed and sent me minidumps with the callstack below. It occurs when they strike several physics bodies with a weapon at the same time. I’m worried this will impact our ability to ship our game.

(It’s worth noting it appears Unity had a similar crash and ended up fixing it: Unity Issue Tracker - physx::Gu::Facet::silhouette crash when colliding with multiple colliders)

[Inline Frame] PhysX3Common_x64.dll!physx::Gu::EdgeBuffer::Insert(physx::Gu::Facet *) Line 212  C++
    [Inline Frame] PhysX3Common_x64.dll!physx::Gu::Facet::silhouette(const unsigned int _index, const __m128 &) Line 291    C++
    PhysX3Common_x64.dll!physx::Gu::Facet::silhouette(const __m128 & w, const __m128 * aBuf, const __m128 * bBuf, physx::Gu::EdgeBuffer & edgeBuffer, physx::Cm::InlineDeferredIDPool<64> & manager) Line 319 C++
    PhysX3Common_x64.dll!physx::Gu::EPA::PenetrationDepth(const physx::Gu::GjkConvex & a, const physx::Gu::GjkConvex & b, const __m128 * __formal, const __m128 * A, const __m128 * B, const int size, __m128 & pa, __m128 & pb, __m128 & normal, __m128 & penDepth, const bool takeCoreShape) Line 625 C++
    PhysX3Common_x64.dll!physx::Gu::epaPenetration(const physx::Gu::GjkConvex & a, const physx::Gu::GjkConvex & b, unsigned char * aInd, unsigned char * bInd, unsigned char _size, __m128 & contactA, __m128 & contactB, __m128 & normal, __m128 & penetrationDepth, const bool takeCoreShape) Line 185    C++
    PhysX3Common_x64.dll!physx::Gu::addGJKEPAContacts(physx::Gu::ShrunkConvexHullV & convexHull, physx::Gu::BoxV & box, const physx::shdfnd::aos::PsMatTransformV & aToB, physx::Gu::GjkStatus status, physx::Gu::PersistentContact * manifoldContacts, const __m128 replaceBreakingThreshold, __m128 & closestA, __m128 & closestB, __m128 & normal, __m128 & penDep, physx::Gu::PersistentContactManifold & manifold) Line 137    C++
    PhysX3Common_x64.dll!physx::Gu::pcmContactBoxConvex(const physx::Gu::GeometryUnion & shape0, const physx::Gu::GeometryUnion & shape1, const physx::PxTransform & transform0, const physx::PxTransform & transform1, const physx::Gu::NarrowPhaseParams & params, physx::Gu::Cache & cache, physx::Gu::ContactBuffer & contactBuffer, physx::Cm::RenderOutput * renderOutput) Line 260   C++
    [Inline Frame] PhysX3_x64.dll!discreteNarrowPhase(physx::PxcNpThreadContext &) Line 399 C++
>    PhysX3_x64.dll!physx::PxcDiscreteNarrowPhasePCM(physx::PxcNpThreadContext & context, const physx::PxcNpWorkUnit & input, physx::Gu::Cache & cache, physx::PxsContactManagerOutput & output) Line 435    C++
    PhysX3_x64.dll!PxsCMDiscreteUpdateTask::processCms<&physx::PxcDiscreteNarrowPhasePCM>(physx::PxcNpThreadContext * threadContext) Line 446 C++
    PhysX3_x64.dll!PxsCMDiscreteUpdateTask::runInternal() Line 519  C++
    PhysX3_x64.dll!physx::Cm::Task::run() Line 67   C++
    Mariana-Win64-Shipping.exe!FPhysXTask::DoTask(enum ENamedThreads::Type,class TRefCountPtr<class FGraphEvent> const &) C++
    Mariana-Win64-Shipping.exe!TGraphTask<class FPhysXTask>::ExecuteTask(class TArray<class FBaseGraphTask *,class FDefaultAllocator> &,enum ENamedThreads::Type)   C++
    Mariana-Win64-Shipping.exe!FTaskThreadAnyThread::ProcessTasksUntilQuit(int) C++
    Mariana-Win64-Shipping.exe!FTaskThreadBase::Run(void)   C++
    Mariana-Win64-Shipping.exe!FRunnableThreadWin::Run(void)    C++
    Mariana-Win64-Shipping.exe!FRunnableThreadWin::GuardedRun(void) C++
    [Frames may be missing, no binary loaded for kernel32.dll]  
    kernel32.dll!00007ffa07c83dc4() Unknown

Well status is unresolved, note that there might not be motivation to fix stuff with PhysX as UE4 is about to switch in to there own physics engine Chaos

There was also talk about in GDC, but video is not yer uploaded from it

I ended up getting an answer from an individual on the Unreal Slackers Discord (fantastic group - highly recommend joining). It’s caused by sphere primitive overlaps. The crash is fixed in PhysX 3.4.3 and UE4.22 has that fix.

Fortunately for us we’re still many months away from launching so we can afford to wait for the stable release of 4.22.

Hope this helps anyone else who encounters the issue!