Invalid Reference / GC Crash on Level Streaming

Hello!

We have been struggling several days with game crashes on our just released game on Steam and Switch - apparently the amount of crashes in our small studio’s internal playtests seemed insignificant but now we’ve had an interesting amount of downloads and crashes have become an issue we must fix urgently!

The crashes would happen on Shipping builds but not in the editor or Development builds. After struggling to get more information on the crashes we were able to attach a development build to VS and using the command line -NoVerifyCG we were able to reproduce the crashes and gather more information. We found a few issues and apparently fixed them but we still have one that is super annoying.

This is the issue:

Ensure condition failed: bIsValidObjectReference [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/CoreUObject/Private/UObject/UObjectGlobals.cpp] [Line: 3390]
Invalid object referenced by the PersistentFrame: 0x000002c46bf8ae80 (Blueprint object: NULL, ReferencingProperty: ObjectProperty /Game/BlueFire/Player/Logic/Player_Character_BP.Player_Character_BP_C:ExecuteUbergraph_Player_Character_BP:CallFunc_BreakHitResult_PhysMat_19, Instance: Player_Character_BP_C /Game/BlueFire/Maps/World/Master.Master:PersistentLevel.Player_Character_BP_C_2147482474, Address: 0x000002c420598ba8) - If you have a reliable repro for this, please contact the development team with it.

[Here is a .txt file with a bit more context:][1]
as you can see the game unloads several streaming levels and loads others afterwards. After loading the new levels the game then makes them visible and that’s when the game crashes (this time the game crashed when making level 3 out of 4 levels for this area visible). The PhysMat_19 also varies from 0 to 19/20. The surfaces are configured correctly in the project settings and everything is working fine in the editor.

We have 4 break hit results in the player character blueprint - I’ll attach a screenshot of each.
Btw, we’re using Physics Materials to detect surfaces for footstep sounds and to check if the player should take damage when touching specific surfaces.

Any help is appreciated.

I can’t say much here but:

  1. I notice one time you start testing the surface before you check if the trace returned a hit, maybe move that swap them over.

  2. When you run this section of code in the editor, do you get any warnings? ( in the log ).

Thanks for the reply.

  1. You’re right I’ll add a branch before that to check if the trace returned a hit. But I’m not sure it will work based on previous tests :frowning:
  2. No, no warnings or errors at all. Only happens on shipping builds or development builds with -NoVerifyCG