Description

ensure(false) being fired in FGenericParticlePairMidPhase::FindOrCreateConstraint from key collision.
The licensee reports one of their users reported this issue and they were able to reproduce a few times in the editor.
I've produced a repro-project and they tweaked it to match their setup.
The level contains two blueprints:
The first is a blueprint that inherits from AGeometryCollectionActor, with Geometry Collection and the settings on it are identical to the ones they are using.
The Second is a blueprint that generates a mesh using the USplineMeshComponent.
The error occurs when the Geometry Collection collides with the mesh generated by the USplineMeshComponent.
There are some attached images that show the state at the moment of the crash.
I've tried reproducing the crash locally but my editor never crashed.
The place they reported the ensure hits does have comments on the need to fix the key uniqueness or else the hash function might generate key collisions.

Steps to Reproduce

I've create a repro project along with the licensee that mimics their local setup (file Repro_17_2.zip), although I was still not able to repro the crash locally with this project.
Download and unzip it.
Change to use Unreal Engine Version to 5.4
Run the sln file and press F5.
Should open on ReproMap.
Play In Editor.

Callstack

I was not able to repro locally so I don't have a call stack. The licensee did not provide one either.
They reported the ensure being hit here:

// @todo(chaos): fix key uniqueness guarantee. We need a truly unique key gen function
#if !UE_BUILD_TEST && !UE_BUILD_SHIPPING
const bool bIsKeyCollision = (Constraint != nullptr) && ((Constraint->GetImplicit0() != InImplicit0) || (Constraint->GetImplicit1() != InImplicit1) || (Constraint->GetCollisionParticles0() != InBVHParticles0) || (Constraint->GetCollisionParticles1() != InBVHParticles1));
if (bIsKeyCollision)

{ // If we get here, we have a key collision. The key uses a hash of pointers which is very likely to be unique for different implicit pairs, // especially since it only needs to be unique for this particle pair, but it is not guaranteed. // Creating a new constraint with the same key could cause fatal problems (the original constraint will be deleted when we add the new one // to the map, but if it is asleep it will be referenced in the contact graph) so we just abort and accept we will miss collisions. // It is extremely unlikely to happen but we should fix it at some point. ensure(false); return nullptr; }

#endif

They also provided some images with the state of the memory when the crash occurs.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-240334 in the post.

0
Login to Vote

Fixed
ComponentUE - Simulation - Physics
Affects Versions5.4.4
Target Fix5.5
Fix Commit34903122
CreatedJan 27, 2025
ResolvedJan 28, 2025
UpdatedJan 28, 2025
View Jira Issue