Would appreciate some help figuring out the cause of recent engine crashes

As of today I have been receiving many engine crashes whilst testing my game. I cant put my finger on the cause of it as they appear to happen randomly. I also lack the knowledge to interoperate the error log.

When the engine crashes, i get this message:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x000001fb763d50d8

PhysX3CommonPROFILE_x64!physx::Gu::TriangleMesh::getTriangleMaterialIndex() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\physx_3.4\source\geomutils\src\mesh\gutrianglemesh.h:97]
PhysX3PROFILE_x64!physx::NpShape::getMaterialFromInternalFaceIndex() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\physx_3.4\source\physx\src\npshape.cpp:464]
UE4Editor_Engine
APEXFrameworkPROFILE_x64!nvidia::apex::ApexSceneUserNotify::onContact() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\apex_1.4\framework\src\apexsceneusernotify.cpp:235]
PhysX3PROFILE_x64!physx::Sc::Scene::fireQueuedContactCallbacks() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\physx_3.4\source\simulationcontroller\src\scscene.cpp:4387]
PhysX3PROFILE_x64!physx::NpScene::fetchResults() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\physx_3.4\source\physx\src\npscene.cpp:2325]
APEXFrameworkPROFILE_x64!nvidia::apex::ApexScene::fetchResults() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\apex_1.4\framework\src\apexscene.cpp:1377]
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

And the bottom of the log it creates in saved/logs says this:

[2022.03.18-21.19.52:646][125]LogWindows: Error: === Critical error: ===
[2022.03.18-21.19.52:646][125]LogWindows: Error: 
[2022.03.18-21.19.52:646][125]LogWindows: Error: Fatal error!
[2022.03.18-21.19.52:646][125]LogWindows: Error: 
[2022.03.18-21.19.52:646][125]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x000001fb763d50d8
[2022.03.18-21.19.52:646][125]LogWindows: Error: 
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8bf9bc5cb PhysX3CommonPROFILE_x64.dll!physx::Gu::TriangleMesh::getTriangleMaterialIndex() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\physx_3.4\source\geomutils\src\mesh\gutrianglemesh.h:97]
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8bf58993c PhysX3PROFILE_x64.dll!physx::NpShape::getMaterialFromInternalFaceIndex() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\physx_3.4\source\physx\src\npshape.cpp:464]
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8cf5e1ca4 UE4Editor-Engine.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8bf3d2794 APEXFrameworkPROFILE_x64.dll!nvidia::apex::ApexSceneUserNotify::onContact() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\apex_1.4\framework\src\apexsceneusernotify.cpp:235]
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8bf68a434 PhysX3PROFILE_x64.dll!physx::Sc::Scene::fireQueuedContactCallbacks() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\physx_3.4\source\simulationcontroller\src\scscene.cpp:4387]
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8bf56ca69 PhysX3PROFILE_x64.dll!physx::NpScene::fetchResults() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\physx_3.4\source\physx\src\npscene.cpp:2325]
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8bf3c92f8 APEXFrameworkPROFILE_x64.dll!nvidia::apex::ApexScene::fetchResults() [d:\build\++fortnite\sync\engine\source\thirdparty\physx3\apex_1.4\framework\src\apexscene.cpp:1377]
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8cf5d6bf0 UE4Editor-Engine.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8cf5b827e UE4Editor-Engine.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8cef79163 UE4Editor-Engine.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8d17b2398 UE4Editor-Core.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8d17b269a UE4Editor-Core.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8d17b2963 UE4Editor-Core.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8cfa19173 UE4Editor-Engine.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8cfa1faba UE4Editor-Engine.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8cf10349f UE4Editor-Engine.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8cf10ea7b UE4Editor-Engine.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff8ceedf56c UE4Editor-Engine.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff7139187a0 UE4Editor.exe!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff713930fcc UE4Editor.exe!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff7139310ba UE4Editor.exe!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff7139340dd UE4Editor.exe!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff713945984 UE4Editor.exe!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff71394853a UE4Editor.exe!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff953647034 KERNEL32.DLL!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: [Callstack] 0x00007ff9555c2651 ntdll.dll!UnknownFunction []
[2022.03.18-21.19.52:646][125]LogWindows: Error: 
[2022.03.18-21.19.52:648][125]LogExit: Executing StaticShutdownAfterError
[2022.03.18-21.19.52:651][125]LogPhysicsCore: Error: PHYSX: (D:\Build\++Fortnite\Sync\Engine\Source\ThirdParty\PhysX3\PhysX_3.4\Source\PhysX\src\NpScene.cpp 238) eINVALID_OPERATION : PxScene::release(): Scene is still being simulated! PxScene::fetchResults() is called implicitly.
[2022.03.18-21.19.52:651][125]LogOutputDevice: Warning: 

Script Stack (0 frames):

[2022.03.18-21.19.52:651][125]LogWindows: Error: Error reentered: Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/Windows/WindowsPlatformMisc.cpp] [Line: 475] 
Pure virtual function being called



[2022.03.18-21.19.52:651][125]LogWindows: Error: HandleError re-entered.
[2022.03.18-21.19.52:651][125]LogWindows: FPlatformMisc::RequestExit(1)
[2022.03.18-21.19.52:651][125]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3)
[2022.03.18-21.19.52:651][125]LogCore: Engine exit requested (reason: Win RequestExit)
[2022.03.18-21.19.52:659][125]Log file closed, 03/18/22 21:19:52

I can only assume it has something to do with me messing around with different physical materials, as that it something I have been doing today.

I appreciate any help that can be given to me. Thanks!

It looks like getTriangleMaterialIndex might be being passed a bad index.
Is there any code you can put before this to make sure you’ve allocated the array and that the index value passed in the correct range?

Ha im gonna be honest and say that 90% of this text sounds like a foreign language to me. xD

I work 100% with blueprints, and I have 0 clue what “getTriangleMaterialIndex” is.

All i have done today is add a new surface type into my project settings, and used a few new physical materials in my levels that use the new surface type.

Make sure you’re setting up your materials and physics correctly. I don’t deal with that area but it may require some type of initializing. Check the documentation.

I have been working on and off the project now for 3-4 years and as far as I can tell nothing has changed as far as how I handle physics and materials. I’m not sure if its relevant, but I also very recently made the switch from UE4.25 to UE4.27.

Given the errors, is it possible to determine a specific blueprint note that I am calling to cause the error, or perhaps a variable that I am trying to access that is causing it?

Sounds like there were changes of some sort between versions of Unreal. Try bypassing physics-related code one by one to narrow down the crash. and check the latest docs.