I am trying to to make a random actor spawner, This spawner works great and spawns 20 physical boxes. game plays normally until I try to quit. This then crashes editor completely.
crash report.
Access violation - code c0000005 (first/second chance not available)
PhysX3PROFILE_x64 + 2700427 bytes
PhysX3PROFILE_x64 + 2902129 bytes
PhysX3PROFILE_x64 + 2779655 bytes
PhysX3PROFILE_x64 + 2774159 bytes
PhysX3PROFILE_x64 + 2493624 bytes
PhysX3PROFILE_x64 + 2531692 bytes
PhysX3PROFILE_x64 + 2488317 bytes
PhysX3PROFILE_x64 + 138437 bytes
PhysX3PROFILE_x64 + 95193 bytes
PhysX3PROFILE_x64 + 454295 bytes
UE4Editor_Engine!TermBodyHelper() + 127 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\physicsengine\bodyinstance.cpp:1493]
UE4Editor_Engine!FBodyInstance::TermBody() + 331 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\physicsengine\bodyinstance.cpp:1545]
UE4Editor_Engine!UPrimitiveComponent::DestroyPhysicsState() + 62 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\primitivecomponent.cpp:483]
UE4Editor_Engine!UActorComponent::ExecuteUnregisterEvents() + 109 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actorcomponent.cpp:968]
UE4Editor_Engine!UActorComponent::UnregisterComponent() + 404 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actorcomponent.cpp:809]
UE4Editor_Engine!AActor::UnregisterAllComponents() + 253 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\actor.cpp:3186]
UE4Editor_Engine!ULevel::ClearLevelComponents() + 284 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\level.cpp:584]
UE4Editor_Engine!UWorld::ClearWorldComponents() + 149 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\world.cpp:1145]
UE4Editor_Engine!UWorld::CleanupWorld() + 532 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\world.cpp:2998]
UE4Editor_UnrealEd!UEditorEngine::TeardownPlaySession() + 3416 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:507]
UE4Editor_UnrealEd!UEditorEngine::EndPlayMap() + 2396 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:182]
UE4Editor_UnrealEd!UEditorEngine::Tick() + 9288 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editor.cpp:1570]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() + 22 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedengine.cpp:347]
UE4Editor!FEngineLoop::Tick() + 4179 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2257]
UE4Editor!GuardedMain() + 1404 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
Stack trace from Visual studio
Unhandled exception at 0x000007FEC910348B (PhysX3PROFILE_x64.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x00000007FFFFFFF8.
Actully it’s not editor crashing but PhysiX library, editor simply goes down with it, so it might be PhysiX bug as well
Hey DatenThielt,
Are you able to reproduce this in a new project, or does it only your current project?
If I use this on a new project, using a blueprint with physics I can replicate this. But I have also solved issue too. I am guessing calling this every tick was not best way to go and have since put it on a timer event ever 2 second and it resolved problem
I’m glad you found a workaround! It still shouldn’t be crashing, though. Is there any chance you could give me details on BuddieBox BP so I can attempt to reproduce it here? Does it only happen with that one BP, or any spawned actor? Does that BP use a specific static mesh that might be causing this? Any other details would be great. Thanks!
Hi . buddie box and its parachute are just mesh’s imported from FBX. blueprint is here.
only non-standard thing really is physics Constraint, event graph just contains a branch to check if its on floor. If it is then stop firing custom function
Hi , I noticed even though I fixed initial error, IF I deploy client it still crashes upon closing with this
There is more information in this one as this was run from source as a standalone client with visual studio symbols added
One more thing. I looked into source and found this.
PRigidActor = NULL; //we must do this within lock because we use it in sub-stepping thread to determine that RigidActor is still valid
I am using physics substepping. I know this is a feature that is not quit finished yet so this could be whole problem all along 
Hi . I ended up disabling Physics substepping, Unfortunately this has not resolved issue and I am once again crashing every time I close client, Any news? 
Hi DatenThielt,
Sorry for delay in response! We’re still looking into this; just wanted to make sure you know we haven’t forgotten you. Thanks for your patience!
Hi DatenThielt,
I’ve attempted to recreate this on my end but I have not been able to get same results you described. I’ve tested this with 4.7.2.
Can you provide Log and dmp files from your project folder > saved > logs?
Also, are you able to produce this in a new project or only this one?
Hi Tim, I have been able to re-produce this on a new project using same kind of box and physics restraints. Here are files you requested. They are all from today as I have had 2-3 crashes with same error as above. link text
Hi Tim
In interest of getting this fixed sooner, I believe I have found a full test case and reason for error.
Its all to do with Destroy Component. In my games my boxes float down, When they are within 2 meters of floor they call destroy component on parachute static mesh. This gives no error, But for some reason causes a crash randomly some times but only when playing game has been stopped… I am currently building a test level that I can upload to prove this.
Destroy Component is called from within box.
This is now starting to effect my whole game as I am starting to build in more interactions with boxes. Once level is uploaded I will provide a link.
Hi again Tim/
Here is link to new project I had created and replicated issues with.
BrokenPhysics.zip - Orangedox.
Instructions:
Load up,
Open level TestWorl.
Hit play
Once all boxes have stopped falling, Stop game (With either esc or clicking Stop) editor will crash with first reported error. It is not 100%. Out of 10 closed, 7 crash. Some times before all boxes had hit floor. Others when they had all come to rest.
If there is a better way for me to package this for you, please let me know.
Thanks!
P.s I also tested destroying cubes themselves with destroy actor and got same crash…
Thanks for project sample.
Unfortunately, I was not able to see a crash with this. On my first attempt editor froze and that was it. I had to manually force close with Ctrl-Alt-Delete. next time I loaded up I’ve been able to use your instructions and have not had an issue as of yet.
It looks like this will need to be looked into a little bit more. So far I’ve start and stopped (after everything has landed and stopped moving) about 30 times in a row with now crash.
I’ll continue and see what I find. At moment it’s not turning up anything that is similar to what you’ve gotten, unfortunately.