Description

The "Find" node can cause a crash if the a map with a struct value changes type while connected, is disconnected and reconnected. Compilation fails and crashes the engine.

Found in 4.23.1 CL#9631420
Reproduced in 4.24 Preview 3 CL#10283392, 4.25 Main CL#10333011

Output:

Fatal error: [Link Removed] [Line: 10]
Cast of Class /Script/Engine.Actor to ScriptStruct failed
UE4Editor-Win64-Debug.exe has triggered a breakpoint.

Steps to Reproduce

1. In blueprints create a Map with Actor Reference key and Hit Result value(DemoMapVar).
2. In the eventgraph call a "Find" node from DemoMapVar and split the struct pin.
3. Connect at least one output to array input node by connecting to a "Make Array" and promoting that output to a new variable.
4. Add an Event Tick node to the blueprint and connect it to the Set variable node
4. Save and compile the blueprint.
5. Change DemoMapVar's value to from Hit Result to Actor Object Reference.
6. Disconnect the DemoMapVar from the "Find" node, reconnect it and compile the blueprint.

Result: The engine crashes.

Expected: The engine throws an compile error in the blueprint without crashing.

NOTE: The attached image shows how to set up the blueprint.

Callstack
>	UE4Editor-CoreUObject-Win64-Debug.dll!CastLogError(const wchar_t * FromType, const wchar_t * ToType) Line 10	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!CastChecked<UScriptStruct,UObject>(UObject * Src, ECastCheckedType::Type CheckType) Line 233	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!UEdGraphSchema_K2::CreateSplitPinNode(UEdGraphPin * Pin, const UEdGraphSchema_K2::FCreateSplitPinNodeParams & Params) Line 6803	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!UK2Node::ExpandSplitPin(FKismetCompilerContext * CompilerContext, UEdGraph * SourceGraph, UEdGraphPin * Pin) Line 1217	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!UK2Node::ExpandNode(FKismetCompilerContext & CompilerContext, UEdGraph * SourceGraph) Line 1278	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!UK2Node_CallFunction::ExpandNode(FKismetCompilerContext & CompilerContext, UEdGraph * SourceGraph) Line 2176	C++
 	UE4Editor-KismetCompiler-Win64-Debug.dll!FKismetCompilerContext::ExpansionStep(UEdGraph * Graph, bool bAllowUbergraphExpansions) Line 3128	C++
 	UE4Editor-KismetCompiler-Win64-Debug.dll!FKismetCompilerContext::CreateAndProcessUbergraph() Line 3374	C++
 	UE4Editor-KismetCompiler-Win64-Debug.dll!FKismetCompilerContext::CreateFunctionList() Line 3860	C++
 	UE4Editor-KismetCompiler-Win64-Debug.dll!FKismetCompilerContext::CompileClassLayout(EInternalCompilerFlags InternalFlags) Line 4072	C++
 	UE4Editor-Kismet-Win64-Debug.dll!FBlueprintCompilationManagerImpl::FlushCompilationQueueImpl(bool bSuppressBroadcastCompiled, TArray<UBlueprint *,TSizedDefaultAllocator<32> > * BlueprintsCompiled, TArray<UBlueprint *,TSizedDefaultAllocator<32> > * BlueprintsCompiledOrSkeletonCompiled, FUObjectSerializeContext * InLoadContext) Line 1150	C++
 	UE4Editor-Kismet-Win64-Debug.dll!FBlueprintCompilationManagerImpl::CompileSynchronouslyImpl(const FBPCompileRequestInternal & Request) Line 262	C++
 	UE4Editor-Kismet-Win64-Debug.dll!FBlueprintCompilationManager::CompileSynchronously(const FBPCompileRequest & Request) Line 2916	C++
 	UE4Editor-UnrealEd-Win64-Debug.dll!FKismetEditorUtilities::CompileBlueprint(UBlueprint * BlueprintObj, EBlueprintCompileOptions CompileFlags, FCompilerResultsLog * pResults) Line 754	C++
 	UE4Editor-Kismet-Win64-Debug.dll!FBlueprintEditor::Compile() Line 3387	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TMemberFunctionCaller<FBlueprintEditor,void (__cdecl FBlueprintEditor::*)(void)>::operator()<>() Line 157	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,FBlueprintEditor,0,TTypeWrapper<void> __cdecl(void)>::Execute() Line 293	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,FBlueprintEditor,0,void __cdecl(void)>::ExecuteIfSafe() Line 371	C++
 	UE4Editor-Slate-Win64-Debug.dll!TBaseDelegate<void>::ExecuteIfBound() Line 673	C++
 	UE4Editor-Slate-Win64-Debug.dll!FUICommandList::ExecuteAction(const TSharedRef<FUICommandInfo const ,0> InUICommandInfo) Line 103	C++
 	UE4Editor-Slate-Win64-Debug.dll!SToolBarButtonBlock::OnClicked() Line 302	C++
 	UE4Editor-Slate-Win64-Debug.dll!TMemberFunctionCaller<SToolBarButtonBlock,FReply (__cdecl SToolBarButtonBlock::*)(void)>::operator()<>() Line 156	C++
 	UE4Editor-Slate-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,SToolBarButtonBlock,0,FReply __cdecl(void)>::Execute() Line 293	C++
 	UE4Editor-Slate-Win64-Debug.dll!SButton::ExecuteOnClick() Line 385	C++
 	UE4Editor-Slate-Win64-Debug.dll!SButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 304	C++
 	UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda>(const FArrangedWidget & TargetWidget, const FPointerEvent & Event) Line 4626	C++
 	UE4Editor-Slate-Win64-Debug.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,FReply <lambda>(const FArrangedWidget &, const FPointerEvent &) >(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::FReply <lambda>(const FArrangedWidget &, const FPointerEvent &) & Lambda) Line 372	C++
 	UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 4612	C++
 	UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) Line 5135	C++
 	UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const FVector2D CursorPos) Line 5103	C++
 	UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 1958	C++
 	UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,0> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 2410	C++
 	UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 959	C++
 	UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 788	C++
 	[External Code]	
 	UE4Editor-ApplicationCore-Win64-Debug.dll!WinPumpMessages() Line 109	C++
 	UE4Editor-ApplicationCore-Win64-Debug.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 133	C++
 	UE4Editor-Win64-Debug.exe!FEngineLoop::Tick() Line 4397	C++
 	UE4Editor-Win64-Debug.exe!EngineTick() Line 63	C++
 	UE4Editor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 176	C++
 	UE4Editor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 252	C++
 	[External Code]	

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-84882 in the post.

1
Login to Vote

Fixed
ComponentUE - Gameplay
Affects Versions4.23.14.244.25
Target Fix4.24
Fix Commit10365905
Main Commit10365906
Release Commit10365908
CreatedNov 21, 2019
ResolvedNov 22, 2019
UpdatedJan 25, 2021