Packaged Game Intermittently Crashing when loading level
I've been having this problem since 4.17 where my packaged game intermittently crashes because of failing "ensure"s but I have no idea how to debug this and if this is bug with the engine:
Looks like you are running a for loop on an array and changing the size of the array within the loop itself. That causes an error because the for loop doesn't know anymore how many elements it has to loop over.
answered Feb 05 '18 at 03:10 PM
I solved an issue similar to this and hope this message helps someone in the future. I had crashes only in packaged builds (never editor) with the following log error:
Experienced devs told me 99% of the time it's a null pointer error, meaning you are referencing something in your c++ or blueprints which can't be referenced (usually because it doesn't exist, for example it hasn't yet been instantiated). This was true in my case.
The way to solve this issue:
1) Look in your log folder. ([yourprojectname]>Saved>Crashes). Look for the FATAL ERROR near the end and look underneath that for the callstack hint which will steer you where your problem is. In my case, it looked like this:
Notice the last message in mine. It contains the words "skeletalMesh", "sort", "TBitArray". In my case, the null pointer was a reference to a skeletal mesh inside of a switch.
2) Go into a blueprint you think the log could be referring to and disconnect the tick, begin play, and constructor wires, effectively deactivating the blueprint, and then package and run. If it stops crashing, you've found the blueprint with your toxic reference. You're zeroing in!
3) Reconnect your wires and disconnect only the part you think is responsible until the packaged build stops crashing. Find your bad reference, and then figure out why it's a bad reference. Have you instantiated it yet? (You can put in printstrings, or you can put in breakpoints and step through your blueprints to find out). In my case, it was something stranger which really threw me off: I had imported the mesh from Blender with the skeleton turned to invisible. This was enough to throw off ue4, but only when ue4 was trying to load it (hence why only the crashes in packaged builds).
The first time debugging something like this is hell, but have faith that you can and will get through it, and once you do, you'll have tremendous confidence moving forward!
answered Aug 05 '18 at 06:11 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here