Serialize causes crash

I tried to update my project to 4.8 and I have been getting a lot of bugs many of which cannot be easily understood since the Crash reporter conveniently omits the parts that matter the most. It seems that the troubles are linked to my Game Mode class. The class is in C++ with a BP instance used for easy modifications. Whenever I try to edit the BP I get a crash on Serialize(). The only changes I made was to add _Implementation to 2 functions that were being overridden. Besides that nothing else has changed. Yet, launching the game is now impossible. Also, for some reason when attempting to load my character, an endless loop happens that calls its constructor indefinitely. Again, it’s linked to Serialize(). I would post logs but I don’t think they would be of any use without seeing the structure of the classes.

MachineId:066647754701E1F9FD350EB33927B083
EpicAccountId:f81843e36b10453097d8d52f6d79d7c7

Unknown exception - code 00000001 (first/second  not available)

"Assertion failed: !DelegateInstanceInterface->IsSameFunction(*InDelegateInstance) [File:c:\program files\epic games\4.8\engine\source\runtime\core\

KERNELBASE
UE4Editor_Core!FOutputDeviceWindowsError::Serialize() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:95]
UE4Editor_Core!FOutputDevice::Logf__VA() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\misc\outputdevice.cpp:144]
UE4Editor_Core!FDebug::AssertFailed() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\misc\outputdevice.cpp:355]
UE4Editor_ThirdPersonShooter
UE4Editor_ThirdPersonShooter
UE4Editor_ThirdPersonShooter
UE4Editor_ThirdPersonShooter
UE4Editor_CoreUObject!UClass::CreateDefaultObject() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\coreuobject\private\uobject\class.cpp:2587]
UE4Editor_CoreUObject!UClass::GetDefaultObject() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\coreuobject\public\uobject\class.h:2091]
UE4Editor_KismetCompiler!FKismetCompilerContext::FinishCompilingClass() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\kismetcompiler\private\kismetcompiler.cpp:1798]
UE4Editor_KismetCompiler!FKismetCompilerContext::Compile() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\kismetcompiler\private\kismetcompiler.cpp:3501]
UE4Editor_KismetCompiler!FKismet2CompilerModule::CompileBlueprintInner() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\kismetcompiler\private\kismetcompilermodule.cpp:99]
UE4Editor_KismetCompiler!FKismet2CompilerModule::CompileBlueprint() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\kismetcompiler\private\kismetcompilermodule.cpp:168]
UE4Editor_UnrealEd!FKismetEditorUtilities::CompileBlueprint() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\unrealed\private\kismet2\kismet2.cpp:739]
UE4Editor_Kismet!FBlueprintEditor::Compile() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\kismet\private\blueprinteditor.cpp:3016]
UE4Editor_Kismet!TBaseSPMethodDelegateInstance<0,FBlueprintEditor,0,TTypeWrapper<void> __cdecl(void)>::Execute() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:282]
UE4Editor_Kismet!TBaseSPMethodDelegateInstance<0,FBlueprintEditor,0,void __cdecl(void)>::ExecuteIfSafe() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:388]
UE4Editor_Slate!FUICommandList::ExecuteAction() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\commands\uicommandlist.cpp:75]
UE4Editor_Slate!SToolBarButtonBlock::OnClicked() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\multibox\stoolbarbuttonblock.cpp:296]
UE4Editor_Slate!TMemberFunctionCaller<SToolBarButtonBlock,FReply (__cdecl SToolBarButtonBlock::*)(void) __ptr64>::operator()<>() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\delegateinstanceinterface_variadics.h:161]
UE4Editor_Slate!TTupleImpl<TIntegerSequence<> >::ApplyAfter_ExplicitReturnType<FReply,TMemberFunctionCaller<SToolBarButtonBlock,FReply (__cdecl SToolBarButtonBlock::*)(void) __ptr64> >() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\tuple.h:113]
UE4Editor_Slate!TBaseSPMethodDelegateInstance<0,SToolBarButtonBlock,0,FReply __cdecl(void)>::Execute() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:282]
UE4Editor_Slate!TBaseDelegate<FReply>::Execute() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:440]
UE4Editor_Slate!SButton::OnMouseButtonUp() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\widgets\input\sbutton.cpp:225]
UE4Editor_Slate!<lambda_de96dc3471181973108233c6db1f9843>::operator()() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4170]
UE4Editor_Slate!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_de96dc3471181973108233c6db1f9843> >() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:212]
UE4Editor_Slate!FSlateApplication::ProcessMouseButtonUpEvent() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4173]
UE4Editor_Slate!FSlateApplication::OnMouseUp() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4133]
UE4Editor_Core!FWindowsApplication::ProcessDeferredMessage() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsapplication.cpp:1406]
UE4Editor_Core!FWindowsApplication::DeferMessage() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsapplication.cpp:1711]
UE4Editor_Core!FWindowsApplication::ProcessMessage() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsapplication.cpp:706]
UE4Editor_Core!FWindowsApplication::AppWndProc() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsapplication.cpp:628]
user32
user32
UE4Editor_Core!FWindowsPlatformMisc::PumpMessages() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsplatformmisc.cpp:792]
UE4Editor!FEngineLoop::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\launch\private\launchengineloop.cpp:2319]
UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]

My GameMode class is modified as well and derived from blueprints. At first, I only overwrote beginplay. I recently have overwritten a few other functions. In my project, the map and everything loads fine. As soon as I open any blueprint, the game crashes.Mine does the exact same thing and throws a serialize error anytime I open a blueprint. Downgrading back to 4.7.6, I can immediately open any blueprint that was crashing on 4.8.

Edit: The other odd thing is that I only recently implemented my custom game mode (derived my class from it). My crashes were occurring before it was called. Was there anything you changed that allows your game to work correctly on 4.8?

Have you tried looking at your text log, the file that is created each time you play?

Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.8\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 678]
Array index out of bounds: 11 from an array of size 11

That’s about the only thing that i am noticing. This occurs right before the Serialze() problem.

Hi ,

Could you please provide some additional information to help me reproduce this issue?

  • Are you using the Binary version of the Engine, or did you build the Engine from source code?
  • Would it be possible to see the code for your GameMode class?
  • What specific changes, if any, did you make to your class when upgrading to 4.8?
  • Does this crash occur while you are editing the GameMode Blueprint, or when actually launching the game? Do you also see the crash in a packaged version of the game?

I was told to post here, but I too suffer from this problem.

Adding to what I said in that link, I have a second project that is now suffering from the same problem.

Hi nossr50,

Would you be able to provide more information with regards to what class you created, and what changes you made to it before performing a hot reload and seeing this crash occur?

I’m having this same issue with just a few items in my project though. One is a blueprint actor that is used heavily and needs to be worked in a lot so really need to get it working in 4.8. Also the level that contains that blueprint can’t be opened or it will also crash the engine

I found this post from following nossr50. Attached a copy of my dump. link text

Hi Hawk,

Would you be able to upload the .uasset file for the Blueprint that is giving you trouble? Are you able to open this Blueprint at all in the Editor? Does the Blueprint derive from a custom code class? If so, could you also include the code for that class?

I don’t have the project with me currently, but I did figure out what was causing the engine to crash. I’m attaching a screenshot of what my issue is that I created real quick. And some steps below to reproduce.

Steps to reproduce:

  1. Create Game Instance
  2. Make a Random Stream Variable inside the Game Instance
  3. Set your Newly made Game Instance your projects Game instance
  4. Create a new BP called “BP” (can be anything just saying BP for reference in rest of steps.)
  5. Inside of BP make a Random Stream Variable
  6. Inside Construction Script “Get Game Instance” and “cast to your game instance”
  7. Drag off cast pin to promote it to a variable
  8. Get your promoted Cast variable and drag off it and get your Random Stream variable from Game Instance
  9. Set your BP Random Stream to be your Random Stream From your Game Instance.
  10. On cast fail drag it to set the BP’s Game Instance.
  11. Compile and Engine will crash.

To answer your other questions, I’m unable to open the blueprint as it was. I got around this by unhooking The Construction Pin, Event Begin Play, and Event Tick pins from my blueprint in 4.7.6 then moving it into my 4.8 project then opening it up. Then stepping through until I found the issue. (thankfully it was pretty early on.)

It was not from a custom code class.

If people know which bp’s are causing issues I recommend also unhooking things in an earlier version of the engine then finding out what it is like I did. Of course if they’re issue is the same, it should work.

Image:

Also to note this happened using a Random Stream for this. When I tried integers or booleans it didn’t cause it to crash. So not sure if any other variables will cause this issue.

Hi Hawk,

Thank you for providing the repro steps that you listed. Using those, and the screenshot, I was able to reproduce your crash. I have submitted a report of my findings to have this investigated further (UE-17541).

Unfortunately, the more I look into all of the Serialize() crashes that have been reported, the more I am convinced that they are actually (mostly) different crashes. I still need to get some more information from @, @walk12288, and @anonymous_user_87222136 in order to try to figure out their crashes.

Hi ,

I’m sorry but apparently my reply wasn’t posted. About the crash I originally posted about, as far as I could tell, it was something related to my bots, at least that what I saw with the debugger. Eventually the bug disappeared on its own without me doing anything which is pretty strange as well. The last issue I had was related to LoadGame in UGameplayStatics. It had the nasty side effect of locking my entire machine for some reason. My guess is that 4.7 save games don’t play along with 4.8. By deleting the save game file and letting the engine create a new one the problem was gone.

Ultimately I decided to remake the project from scratch. It had started with version 4.6 so I decided it was a good time to start fresh. I’m sorry that I cannot provide further assistance.

Hi ,

No problem, we do sometimes have replies go missing on Answerhub. I am glad to hear that things appear to be working fine for you now. I will see if I can look into the save game issue that you described, though.

I’m also getting the crash whenever I create a code class in my project (currently running stock 4.8.1), here’s the first line of the crash log:

Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.8\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 678]
Array index out of bounds: -1 from an array of size 0

Hi ,

Could you please post the full callstack that you see in the crash reporter?

link text

Hi ,

Sorry for the delayed response. Do you still see this happening in 4.8.2?

When you say you are using “stock 4.8.1” do you mean that you are using the binary version installed by the Launcher, or that you built the Engine from source code without making any changes to the source code? Is this only occurring in your own project (if you make a new project, does it work fine?)? At what point does the crash occur (immediately after clicking the Create Class button, at some point before Visual Studio opens, after Visual Studio has opened)? Is the new code class successfully added to the project?

Hi ,

We haven’t heard back from you for a few days. Do you still need help with this issue? I will be marking this issue as resolved for internal tracking purposes, but please feel free to add a comment if you still need assistance.

Hi ,

I didn’t end up seeing your response to this question, but here we are again!

I have not been able to resolve this issue in any version of 4.9 nor the newest 4.10 update. Attached is my most recent crashlog when I try to create a new C++ from within the UE4 editor. The class is successfully created but the engine crashes during code compilation. Any suggestions you might have would be greatly appreciated. link text