Huge freeze while playing (chaos engine issue)

Hi!

The game froze for about 10 seconds while playing in editor. I retrieved the following errors from the log and I looked at the code mentioned but I’m unsured what’s wrong. Would you have any idea by any chance?
Thanks a lot!

Error:

[2023.12.07-04.01.49:611][888]LogStats: FPlatformStackWalk::StackWalkAndDump -  0.144 s
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: === Handled ensure: ===
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: 
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: Ensure condition failed: !Constraint.AccumulatedImpulse.ContainsNaN() && FMath::IsFinite(Constraint.GetPhi())  [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Private\EventDefaults.cpp] [Line: 139] 
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: 
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: Stack: 
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa6c26318 UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa68d8aac UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa68bbae1 UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa68fb827 UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa68fc586 UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa68f5b56 UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa6c22f46 UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa6c554cf UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa6c464fa UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa6d59399 UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa6d4559b UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa68e488d UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffaa68ed274 UnrealEditor-Chaos.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffadd82227d UnrealEditor-Core.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffadd82afd3 UnrealEditor-Core.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffadd838cd5 UnrealEditor-Core.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffadd838a7c UnrealEditor-Core.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffadd8180e2 UnrealEditor-Core.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffadd8608c2 UnrealEditor-Core.dll!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffadd828b60 UnrealEditor-Core.dll!UnknownFunction []
[......]
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffb15fa7344 KERNEL32.DLL!UnknownFunction []
[2023.12.07-04.01.49:611][888]LogOutputDevice: Error: [Callstack] 0x00007ffb17c026b1 ntdll.dll!UnknownFunction []

The ENSURE mentioned:

if (ensure(!Constraint.AccumulatedImpulse.ContainsNaN() && FMath::IsFinite(Constraint.GetPhi())))
							{
	
								const FPerShapeData* Shape0 = Constraint.GetShape0();
								const FPerShapeData* Shape1 = Constraint.GetShape1();

								// If we don't have a filter - allow the notify, otherwise obey the filter flag
								const bool bFilter0Notify = Shape0 ? Shape0->GetSimData().HasFlag(EFilterFlags::ContactNotify) : true;
								const bool bFilter1Notify = Shape1 ? Shape1->GetSimData().HasFlag(EFilterFlags::ContactNotify) : true;

								if(!bFilter0Notify && !bFilter1Notify)
								{
									// No need to notify - engine didn't request notifications for either shape.
									continue;
								}

								const FGeometryParticleHandle* Particle0 = Constraint.GetParticle0();
								const FGeometryParticleHandle* Particle1 = Constraint.GetParticle1();
								const FKinematicGeometryParticleHandle* Body0 = Particle0->CastToKinematicParticle();

								// presently when a rigidbody or kinematic hits static geometry then Body1 is null
								const FKinematicGeometryParticleHandle* Body1 = Particle1->CastToKinematicParticle();

								const FKinematicGeometryParticleHandle* Primary = Body0 ? Body0 : Body1;
								const FKinematicGeometryParticleHandle* Secondary = Body0 ? Body1 : Body0;

								//
								const int32 NumManifoldPoints = Constraint.GetManifoldPoints().Num();

								if (((Constraint.IsProbe() && NumManifoldPoints > 0) || !Constraint.AccumulatedImpulse.IsZero()) && Primary)
								{
									if (ensure(!Constraint.CalculateWorldContactLocation().ContainsNaN() &&
										!Constraint.CalculateWorldContactNormal().ContainsNaN()) &&
										!Primary->V().ContainsNaN() &&
										!Primary->W().ContainsNaN() &&
										(Secondary == nullptr || ((!Secondary->V().ContainsNaN()) && !Secondary->W().ContainsNaN())))
									{
										ValidArray[Index] = true;
									}
								}
							}

PS:

  • I’m only using Blueprints at the moment, no C++ was modified
  • UE 5.3

Hey there @Nimillion! That’s an interesting one, it seems like either the total impulse that is applied to the object is so high that it becomes NaN or is considered infinite. How does this trigger? Only when applying extreme forces?

Thanks for your reply!

I have a rocketship which is moved by applying forces which are controlled by the player.

  • The player add forces to move forward and rotate
  • The ship has an ANTI GRAVITY force always applied (small force UP to counter gravity)

Note:

  • The recent change I made was to deactivate / re-activate the ANTI GRAVITY perk when fuel is low. This adds force with the node ADD FORCE → FORCE Z=400000.0
    (during flight: if fuel low => do not ADD FORCE up.
    after refuelling: ADD FORCE up)
  • I never had a problem before until I did this. (been working on this for 1 year)

Thank you very much!

I’m not sure how it was triggered.

I did another test but could not reproduce the issue. I don’t think that it happened when the ANTI GRAVITY was deactivated. Pretty sure it happened while flying as usual without doing anything special or hitting any other actor (was just applying the usual forces used when flying).

You mention extreme forces. Perhaps, I could clamp the maximum amount of forces that can be applied?

If not extreme forces, it could be that they were changing too fast between physics ticks. Are there cases where during normal ticks where it bounces back and forth between being applied and not? I’m currently unable to replicate this so far.

1 Like
  • I will check that and will let you know if I can see this happening but I never felt it and I can’t reproduce the issue at the moment.

All that said, just in case it could be causing this issue:

  • My editor started freezing a few days ago when using the SIMULATE mode (I stopped using this mode for now)
  • Since this Chaos issue, I get more freezes. I just got 1 when PLAYING IN EDITOR on QUIT. It freezes with no crash. This time, my game no longer loads my title screen… Last time this happened, I compiled my game Instance without changing anything and it worked again… weird, I’m not an expert.

Unfortunately, I don’t usually see any error after a freeze.

I’m going to try and delete all cache.

It looks like my Freezes may have been caused by my game instance which is using SPAWN SOUND 2D with the Sound base object input set using a soft reference rather than the actual object. When I use the object reference, the title screen loads again.

I will continue to work and stay on the topic of the issue with Chaos for this thread. If I get another crash, I’ll log the GRAVITY ACTIVATION and see if there is any unwanted behaviour there.

Thanks a lot for your help, that’s incredible!

Understandable, if it turns out the chaos side crashes keep occurring, definitely keep us updated. Physics crashes can be a bit esoteric sometimes, so it’s good to have all the data we can get.

Got the crash again. Here is the full crash log attached.

chaos_crash.txt (287.4 KB)
Hopefully no sensitive info left inside (please feel free to remove this after downloading if it’s a problem).

The crash happened shortly after entering a ZERO GRAVITY field (but not immediately, maybe 1 second after).

Thanks!

FYI, I could also get this from the crash dump:
(Uploaded the TXT file above as well)

*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************


KEY_VALUES_STRING: 1

    Key  : Analysis.CPU.mSec
    Value: 1109

    Key  : Analysis.DebugAnalysisManager
    Value: Create

    Key  : Analysis.Elapsed.mSec
    Value: 52903

    Key  : Analysis.IO.Other.Mb
    Value: 40

    Key  : Analysis.IO.Read.Mb
    Value: 1

    Key  : Analysis.IO.Write.Mb
    Value: 92

    Key  : Analysis.Init.CPU.mSec
    Value: 2374

    Key  : Analysis.Init.Elapsed.mSec
    Value: 1636801

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 916

    Key  : Timeline.Process.Start.DeltaSec
    Value: 1774

    Key  : WER.OS.Branch
    Value: vb_release

    Key  : WER.OS.Timestamp
    Value: 2019-12-06T14:06:00Z

    Key  : WER.OS.Version
    Value: 10.0.19041.1

    Key  : WER.Process.Version
    Value: 5.3.0.0


FILE_IN_CAB:  UEMinidump.dmp

CONTEXT:  (.ecxr)
rax=0000000000000000 rbx=000000ab501f44f0 rcx=0000000000000000
rdx=0000000000000000 rsi=00007ffaa4066318 rdi=00007ffade8c1701
rip=00007ffb1556cf19 rsp=000000ab501f3af0 rbp=000000ab501f3d30
 r8=0000000000000000  r9=0000000000000000 r10=00007ffb17bee26f
r11=0000000000000000 r12=00000000000011d0 r13=0000000000000002
r14=0000000000000000 r15=00007ffade8fc030
iopl=0         nv up ei pl nz na pe nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000202
KERNELBASE!RaiseException+0x69:
00007ffb`1556cf19 0f1f440000      nop     dword ptr [rax+rax]
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007ffb1556cf19 (KERNELBASE!RaiseException+0x0000000000000069)
   ExceptionCode: 000bdb30
  ExceptionFlags: 00000000
NumberParameters: 1
   Parameter[0]: 000000ab501f3c10

PROCESS_NAME:  UnrealEditor.exe

ERROR_CODE: (NTSTATUS) 0xbdb30 - <Unable to get error code text>

EXCEPTION_CODE_STR:  bdb30

EXCEPTION_PARAMETER1:  000000ab501f3c10

STACK_TEXT:  
000000ab`501f3af0 00007ffa`dddc38e8     : 00000000`00000000 00000600`f6002290 00000000`00000000 00000000`0006efa0 : KERNELBASE!RaiseException+0x69
000000ab`501f3bd0 00007ffa`dddc371b     : 000000ab`00000002 000000ab`501f44f0 00007ffa`a4066318 000000ab`501f3c10 : UnrealEditor_Core!ReportEnsure+0x308
000000ab`501f3c30 00007ffa`ddb664a7     : 00007ffa`a4066318 00007ffa`a4066318 000000ab`501f4380 000000ab`501f46bc : UnrealEditor_Core!ReportEnsure+0x13b
000000ab`501f4280 00007ffa`ddb7f325     : 00000000`00000000 00000000`00000000 00000000`00000002 00007ffa`a4347240 : UnrealEditor_Core!FDebug::EnsureFailed+0x6a7
000000ab`501fc550 00007ffa`de4596f2     : 00007ffa`a4491080 00000000`00000000 00000000`00000000 3f7ffc00`00000000 : UnrealEditor_Core!FDebug::OptionallyLogFormattedEnsureMessageReturningFalseImpl+0x95
000000ab`501fe5c0 00007ffa`a42ec682     : 3e45798e`e0000000 00000000`00000000 3fb5551d`60000000 00000000`00000000 : UnrealEditor_Core!CheckVerifyImpl+0x62
000000ab`501fe620 00007ffa`a4066318     : fff80000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : UnrealEditor_Chaos!Z_Construct_UScriptStruct_FSolverTrailingFilterSettings+0x7f002
000000ab`501fe670 00007ffa`a3d18aac     : 000000ab`501feb60 000000ab`501feb60 000000ab`00000016 00000000`00000000 : UnrealEditor_Chaos!FWaveScalar::operator==+0x4b58
000000ab`501fe730 00007ffa`a3cfbae1     : 000000ab`501fe790 000000ab`501fe960 00000600`efaa0c00 00000000`c6fb9a00 : UnrealEditor_Chaos!Chaos::FPhysicsSolverBase::~FPhysicsSolverBase+0x61ec
000000ab`501fe860 00007ffa`a3d3b827     : 00000000`00000000 3fefff80`00000000 000000ab`501feb38 000000ab`501feaa8 : UnrealEditor_Chaos!Chaos::ComputeWeakConstraintsColoring<double>+0x24c61
000000ab`501fea50 00007ffa`a3d3c586     : 00000000`00000001 000000ab`501febd0 00007ffa`a3954d10 00000000`00000064 : UnrealEditor_Chaos!Chaos::FHeightField::OverlapGeom+0x117
000000ab`501feae0 00007ffa`a3d35b56     : 00000601`bc5f3b00 000000ab`501fec68 00000000`00000001 00007ffa`a3a0f600 : UnrealEditor_Chaos!Chaos::PhysicsParallelForRange+0x446
000000ab`501fec40 00007ffa`a4062f46     : 00270400`00000016 000000ab`501fef40 00000601`bc5f3b80 00000601`dc818a50 : UnrealEditor_Chaos!Chaos::InnerPhysicsParallelForRange+0x76
000000ab`501feca0 00007ffa`a40954cf     : 00007ffa`a4073cd0 00000601`cbf84800 00000000`00000000 00000000`00000000 : UnrealEditor_Chaos!FWaveScalar::operator==+0x1786
000000ab`501ff000 00007ffa`a40864fa     : 00000601`cbf84800 00000601`dfebb580 00000601`fdef6601 00000000`00000006 : UnrealEditor_Chaos!Chaos::FWeightedLatticeImplicitObject::InitializeDeformedPoints+0x3bf
000000ab`501ff030 00007ffa`a4199399     : 00000000`00000000 00270400`00009e1c 000000ab`501ff180 000000ab`501ff700 : UnrealEditor_Chaos!Chaos::FEventManager::FillProducerData+0x6a
000000ab`501ff080 00007ffa`a418559b     : 00000000`0000ffff 00007ffa`a432a618 00000601`cbf84800 00000000`00000000 : UnrealEditor_Chaos!Chaos::FPBDRigidsSolver::DestroyPendingProxies_Internal+0x2969
000000ab`501ff6e0 00007ffa`a3d2488d     : 00007ffa`a432a618 000000ab`501ff890 00007ffa`a432a630 00000000`00000000 : UnrealEditor_Chaos!Chaos::FPBDRigidsSolver::AdvanceSolverBy+0xdb
000000ab`501ff790 00007ffa`a3d2d274     : 000000ab`501ffa00 00000600`f087b33c 000000ab`501ffa01 00000600`f087b2f0 : UnrealEditor_Chaos!Chaos::FPhysicsSolverAdvanceTask::AdvanceSolver+0x3cd
000000ab`501ff970 00007ffa`dd82227d     : 000000ab`501ffac0 0000028c`bb9dcd20 0000028c`bb9dcd20 00007ffb`127f0000 : UnrealEditor_Chaos!Chaos::FPhysicsSolverBase::EnqueueSimcallbackRewindRegisteration+0x324
000000ab`501ffaa0 00007ffa`dd82afd3     : 00000000`00000001 000000ab`501ffb80 00000000`00000000 00000000`026c68e4 : UnrealEditor_Core!operator<<+0xced
000000ab`501ffb00 00007ffa`dd838cd5     : 0000028d`e320fee0 00000000`026c68e4 0000028d`e320fee0 00000000`00000028 : UnrealEditor_Core!LowLevelTasks::FScheduler::BusyWaitInternal+0x2953
000000ab`501ffb50 00007ffa`dd838a7c     : 026c68e4`00000004 00000000`00000001 0000028c`bcefba0c 0000028c`bcefbec0 : UnrealEditor_Core!FOodleDataCompression::ECompressorToString+0x2025
000000ab`501ffbd0 00007ffa`dd8180e2     : 0000003e`4911f9e4 00000000`00000001 00000000`00000001 00000000`00000001 : UnrealEditor_Core!FOodleDataCompression::ECompressorToString+0x1dcc
000000ab`501ffc40 00007ffa`dd8608c2     : 00000000`00000000 00000000`00000001 00007ffa`de857200 00007ffa`de857200 : UnrealEditor_Core!TThreadSingleton<FThreadIdleStats>::TryGet+0x11432
000000ab`501ffd00 00007ffa`dd828b60     : 0000028c`bb9dccf0 00000600`f05e72c0 00000000`00000001 00000000`000003df : UnrealEditor_Core!UE::ParkingLot::Private::WakeOne+0xc12
000000ab`501ffdd0 00007ffa`dda0f773     : 00000000`00000000 00007ffa`de2f1806 00000600`f058ed00 00000000`00000009 : UnrealEditor_Core!LowLevelTasks::FScheduler::BusyWaitInternal+0x4e0
000000ab`501ffe10 00007ffa`dde44e22     : 00000600`f058ed00 00007ffa`dddb2813 00000000`00000000 00000000`00000000 : UnrealEditor_Core!FThreadHeartBeat::Run+0x43
000000ab`501ffe40 00007ffa`dde38657     : 00000000`00000000 00000000`00000000 00000000`00000000 00000600`f058ed00 : UnrealEditor_Core!FWindowsPlatformProcess::ResolveNetworkPath+0x372
000000ab`501ffe80 00007ffb`15fa7344     : 00000600`f058ed00 00000000`00000000 00000000`00000000 00000000`00000000 : UnrealEditor_Core!FWindowsPlatformTime::GetThreadCPUTime+0x4b7
000000ab`501ffec0 00007ffb`17c026b1     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x14
000000ab`501ffef0 00000000`00000000     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21


SYMBOL_NAME:  unrealeditor_core+308

MODULE_NAME: UnrealEditor_Core

IMAGE_NAME:  UnrealEditor-Core.dll

STACK_COMMAND:  ~12s; .ecxr ; kb

FAILURE_BUCKET_ID:  APPLICATION_FAULT_bdb30_UnrealEditor-Core.dll!Unknown

OS_VERSION:  10.0.19041.1

BUILDLAB_STR:  vb_release

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 10

IMAGE_VERSION:  5.3.0.0

FAILURE_ID_HASH:  {087bde1f-84c4-1046-f6f9-0e000b65d272}

Followup:     MachineOwner
---------

Thanks for that! Doesn’t seem like any warnings or non-fatal errors or anything preceding the crash itself and it’s centered on the number being passed being either NaN or infinite. This adds up all forces that were applied between the physics ticks and then tests it’s validity, though I’m having trouble discerning how it could fail unless game tick and physics tick got so far from each other that your 400000 runs until the overflow point. (Which shouldn’t happen).

I know it would drop the object out of the sky (just for testing something not for a fix), but try dropping the force to something useless but infinitely harder to max out like 400. Does the error still occur? Does it take way longer in the field?

OK will try that. I’m now tracking this force at all time in logs.

Please note that this force is one of the lowest though.

The entire game is based on physics.

I have

  • cables
  • Rocket ship (Main force power: 2000000.0, rotation power: 1500000000.0 (add torque in degrees) gravity stabilizer:400000). The ship also has 1 physic constraint component for suspension
  • rigid bodies with simulation
  • skeletal meshes

Please note the force for rotation. Could that be too huge :slight_smile: I need this much because I use a high angular damping value (feels better for turning). I was turning when both crash happened…

But this issue only started to appear today… Been testing almost every day for months in UE 5.3 with little to no change to these values.

Ahhh the constraints or cables might be getting odd numbers for sure as well. My next thought was to try to isolate the core of the vehicle from the cables, constraints, and physically simulated actors to see if it’s the base or the external components but forces that high it could be a bit hectic. Try also flying though without turning to see if it’s possibly just the torque that’s clipping.

Sorry, I wasn’t clear. The cables are not attached to the ship and they are only used for decoration. They are attached to static machines on one side (the parent actor) and the end is attached to a static object in the world.

I will try everything you mentioned while I’m working on the game. I will also remove a zero or 2 from the rotation but I’m not too hopeful because I never had this problem before using the same forces for months. The cables are fairly new though but they have very limited interaction and no collision with the ship or anything else except 1 specific type of invisible actor which is used to position the cable and avoid clipping through the world. I also never have more than 1 cable at a time on screen.

Thanks, I’ll report back when I get more information.

1 Like