Random crashes on UMG compile

Sometimes appears on different UMG

> [2016.06.02-13.38.48:845][781]LogWindows:Error:
> === Critical error: === Fatal error!
> 
> Unhandled Exception:
> EXCEPTION_ACCESS_VIOLATION reading
> address 0x00000008
> 
> UE4Editor-CoreUObject.dll!StaticDuplicateObject()
> [s:\epic
> games\4.12.0\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1758]
> UE4Editor-UMG.dll!UWidgetBlueprintGeneratedClass::InitializeWidgetStatic()
> [s:\epic
> games\4.12.0\engine\source\runtime\umg\private\widgetblueprintgeneratedclass.cpp:33]
> UE4Editor-UMG.dll!UWidgetBlueprintGeneratedClass::InitializeWidget()
> [s:\epic
> games\4.12.0\engine\source\runtime\umg\private\widgetblueprintgeneratedclass.cpp:155]
> UE4Editor-UMG.dll!UUserWidget::Initialize()
> [s:\epic
> games\4.12.0\engine\source\runtime\umg\private\userwidget.cpp:80]
> UE4Editor-CoreUObject.dll!StaticDuplicateObjectEx()
> [s:\epic
> games\4.12.0\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1937]
> UE4Editor-CoreUObject.dll!StaticDuplicateObject()
> [s:\epic
> games\4.12.0\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1794]
> UE4Editor-UnrealEd.dll!FBlueprintCompileReinstancer::FBlueprintCompileReinstancer()
> [s:\epic
> games\4.12.0\engine\source\editor\unrealed\private\kismet2\kismetreinstanceutilities.cpp:163]
> UE4Editor-UnrealEd.dll!FBlueprintCompileReinstancer::Create()
> [s:\epic
> games\4.12.0\engine\source\editor\unrealed\public\kismet2\kismetreinstanceutilities.h:100]
> UE4Editor-UnrealEd.dll!FKismetEditorUtilities::RecompileBlueprintBytecode()
> [s:\epic
> games\4.12.0\engine\source\editor\unrealed\private\kismet2\kismet2.cpp:918]
> UE4Editor-UnrealEd.dll!FBlueprintCompileReinstancer::ReinstanceObjects()
> [s:\epic
> games\4.12.0\engine\source\editor\unrealed\private\kismet2\kismetreinstanceutilities.cpp:721]
> UE4Editor-KismetCompiler.dll!FKismet2CompilerModule::CompileBlueprint()
> [s:\epic
> games\4.12.0\engine\source\editor\kismetcompiler\private\kismetcompilermodule.cpp:235]
> UE4Editor-UnrealEd.dll!FKismetEditorUtilities::CompileBlueprint()
> [s:\epic
> games\4.12.0\engine\source\editor\unrealed\private\kismet2\kismet2.cpp:756]
> UE4Editor-Kismet.dll!FBlueprintEditor::Compile()
> [s:\epic
> games\4.12.0\engine\source\editor\kismet\private\blueprinteditor.cpp:3184]
> UE4Editor-Kismet.dll!TBaseSPMethodDelegateInstance<0,FBlueprintEditor,0,TTypeWrapper
> __cdecl(void)>::Execute() [s:\epic games\4.12.0\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:321]
> UE4Editor-Kismet.dll!TBaseSPMethodDelegateInstance<0,FBlueprintEditor,0,void
> __cdecl(void)>::ExecuteIfSafe() [s:\epic
> games\4.12.0\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:428]
> UE4Editor-Slate.dll!FUICommandList::ExecuteAction()
> [s:\epic
> games\4.12.0\engine\source\runtime\slate\private\framework\commands\uicommandlist.cpp:87]
> UE4Editor-Slate.dll!SToolBarButtonBlock::OnClicked()
> [s:\epic
> games\4.12.0\engine\source\runtime\slate\private\framework\multibox\stoolbarbuttonblock.cpp:300]
> UE4Editor-Slate.dll!TMemberFunctionCaller (__cdecl SToolBarButtonBlock::*)(void)
> __ptr64>::operator()<>() [s:\epic games\4.12.0\engine\source\runtime\core\public\delegates\delegateinstanceinterface_variadics.h:161]
> UE4Editor-Slate.dll!TTupleImpl int>
> >::ApplyAfter_ExplicitReturnType (__cdecl SToolBarButtonBlock::*)(void)
> __ptr64> >() [s:\epic games\4.12.0\engine\source\runtime\core\public\delegates\tuple.h:128]
> UE4Editor-Slate.dll!TBaseSPMethodDelegateInstance<0,SToolBarButtonBlock,0,FReply
> __cdecl(void)>::Execute() [s:\epic games\4.12.0\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:321]
> UE4Editor-Slate.dll!TBaseDelegate::Execute()
> [s:\epic
> games\4.12.0\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:521]
> UE4Editor-Slate.dll!SButton::OnMouseButtonUp()
> [s:\epic
> games\4.12.0\engine\source\runtime\slate\private\widgets\input\sbutton.cpp:275]
> UE4Editor-Slate.dll!::operator()()
> [s:\epic
> games\4.12.0\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4598]
> UE4Editor-Slate.dll!FEventRouter::Route
> >() [s:\epic games\4.12.0\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:215]
> UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent()
> [s:\epic
> games\4.12.0\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4601]
> UE4Editor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent()
> [s:\epic
> games\4.12.0\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5041]
> UE4Editor-Slate.dll!FSlateApplication::OnMouseUp()
> [s:\epic
> games\4.12.0\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5021]
> UE4Editor-Core.dll!FWindowsApplication::ProcessDeferredMessage()
> [s:\epic
> games\4.12.0\engine\source\runtime\core\private\windows\windowsapplication.cpp:1507]
> UE4Editor-Core.dll!FWindowsApplication::DeferMessage()
> [s:\epic
> games\4.12.0\engine\source\runtime\core\private\windows\windowsapplication.cpp:1847]
> UE4Editor-Core.dll!FWindowsApplication::ProcessMessage()
> [s:\epic
> games\4.12.0\engine\source\runtime\core\private\windows\windowsapplication.cpp:742]
> UE4Editor-Core.dll!FWindowsApplication::AppWndProc()
> [s:\epic
> games\4.12.0\engine\source\runtime\core\private\windows\windowsapplication.cpp:664]
> USER32.dll USER32.dll
> UE4Editor-Core.dll!FWindowsPlatformMisc::PumpMessages()
> [s:\epic
> games\4.12.0\engine\source\runtime\core\private\windows\windowsplatformmisc.cpp:903]
> UE4Editor.exe!FEngineLoop::Tick()
> [s:\epic
> games\4.12.0\engine\source\runtime\launch\private\launchengineloop.cpp:2728]
> UE4Editor.exe!GuardedMain() [s:\epic
> games\4.12.0\engine\source\runtime\launch\private\launch.cpp:148]
> UE4Editor.exe!GuardedMainWrapper()
> [s:\epic
> games\4.12.0\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
> UE4Editor.exe!WinMain() [s:\epic
> games\4.12.0\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
> UE4Editor.exe!__tmainCRTStartup()
> [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
> KERNEL32.DLL ntdll.dll ntdll.dll

Hello Whiz652,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints/widgets that may be involved with this issue?

I constantly get crashes in UMG when attempting to compile, and I have created a clean first person shooter project.

  1. create a subfolder under the content folder call it Test.
  2. create a subfolder under Test called UI
  3. create a subfolder under Test called Elements.
  4. create a UMG Widget call it ElementBase, here I put common functions and variables for my UI Elements, such as a text variable called ButtonText.
  5. create a UMG Widget derived from ElementBase, I called mine Button400x100.
  6. Create 2 buttons, as children of Canvas Panel. Set Canvas Panel to size of button, say 400 x 100. Add Text to both buttons, and bind them to ButtonText in the ElementBase parent.
  7. Move those 2 buttons so they are on top of each other, call one Button_Normal, the other Button_Highlight. They must be exactly on top of each other, and then hide Button_Highlight in the editor.
  8. Now in UI folder, create a widget called MainMenu
  9. Add 6 Button400x100 widgets and position them on screen.

Now if I start changing Button400x100, or work on ElementBase widget, crashes will occur when compiling.

If I attempt to rename either Button400x100 or ElementBase when it is used by more than 1 widget, a crash will always occur without mercy when updating references. Its possible that it is the references that cause random crashes to occur when compiling as well (i’m up to about 25 crashes today).

I found the way to reproduce it. The source of it is adding user created widgets to another user created widget not dynamicly.

  1. Create 1_Widget
  2. Create 2_Widget
  3. Add 2_Widget to 1_Widget
  4. Change something in 2_Widget (I added custom event for example)
  5. Compile 2_Widget
  6. Fatal error!

Hello Whiz652,

After doing a bit more digging I found that this is a known issue (UE-31570) and it has been resolved internally. The solution for this issue will be available in an upcoming 4.12 hotfix. Thank you for your time and information.

Make it a great day

When can we expect this hotfix to come? I have to do workaround for this bug: instead of compiling blueprint, save it and restart editor, but it’s a real pain… I hope hotfix will come soon.

For me, a work around that seems to work right now is make sure that I have no other blueprints open when I attempt to compile a blueprint that causes a crash (such as one that is added to another blueprint).

Guess I picked a terrible week to start building UI.

There is a fix available on GitHub. If you can recompile the engine, you can apply it right now:

I have the fix and the engine crashes literally every time I compile a change to a widget…

@vanlacke: What’s the stack trace? I had it crash all the time before the fix. Not a single crash after switching to the WIP branch.

Sorry, I don’t know what that is… Do you mean the data when the engine crashed? I’m not getting the typical crash window - it’s just a dialog box with “fatal error”

All I did was apply the line to my current engine build as someone else suggested. Was that the incorrect way?

When there’s a crash and there are debug symbols available, you usually get a window with details & a list of functions. It’s usually in the log too. The function at the top is the crash location.

I’ve seen the plain “Fatal Error” crash a few times but I attributed that to my own code & hot reloading in particular.

Thanks for the replies, I undid the change, and reapplied, and now it works. Not entirely sure what I did different… Thank you for the fix link!!

I spent way too long trying to debug what was wrong with my project and even started a brand new project and remade everything just to find this was a problem with the engine.

I have found no way to avoid it. Had to set my autosave to 2 minutes. It seems when clicking “compile” the code actually DOES compile, it just crashes after. So re-launching it will have the compiled version.

I have attempted GRWalton’s suggestion of having no other blueprints open when compiling but it does not work in my scenario. For now this is a constant headache, needing to restart the engine around once every 3 minutes. Really hope that hotfix isn’t long in development.

@Chumble: hotfix is out ^^

Now I’m just crashing non-stop even outside of UMG. Rolling back to 4.11.2 with a new project. Again.

Hello Chumble,

Could you provide the complete callstack for the crash(es) that you are having?

I’m not sure how to give you that info. I just loaded up the crashing project, tried to compile my character blueprint and crashed - I see the folder created with the crash info, is the info you need in there?

As a side note, I spent the day remaking the core elements of my project in 4.11.2 and that project is currently crash free.

We have the same problem as Chumble. Not a single change can be made without the project crashing in UMG and now after the 4.12.1 the blueprints are also affected.