Editor crashdumps when using blueprint class events declared as private in C++ parent class

Unreal Engine 4.2.1 Development under Windows 8.1 64-bit:

I mistakenly declared a private blueprint implementable event in a C++ class like so:

UCLASS(config=Game)
class ASomeClass
{
    ...
private:
    UFUNCTION(BlueprintImplementableEvent, Category = Foo)
    virtual void Bar();
    ...
}

Obviously this is wrong as blueprint classes derived from ASomeClass won’t be able to call Bar(). But no warnings were issued by the compiler that anything was funky.

When I created a blueprint class BP_SomeClass derived from ASomeClass then tried to use the event in the blueprint event graph, the editor quietly crashdumped in the background, then continued working. The crashdump exception is:

Unhandled exception at 0x00007FF9707B5BF8 (KERNELBASE.dll) in Dump300533408.dmp: 0x00000001: Incorrect function.

The callstack is:

 	KERNELBASE.dll!00007ff9707b5bf8()	Unknown
 	UE4Editor-Core.dll!NewReportEnsure(const wchar_t * ErrorMessage) Line 366	C++
 	UE4Editor-Core.dll!FDebug::EnsureFailed(const char * Expr, const char * File, int Line, const wchar_t * Msg) Line 300	C++
>	UE4Editor-KismetCompiler.dll!FKismetCompilerContext::FinishCompilingFunction(FKismetFunctionContext & Context) Line 1448	C++
 	UE4Editor-KismetCompiler.dll!FKismetCompilerContext::Compile() Line 3128	C++
 	UE4Editor-KismetCompiler.dll!FKismet2CompilerModule::CompileBlueprintInner(UBlueprint * Blueprint, bool bPrintResultSuccess, const FKismetCompilerOptions & CompileOptions, FCompilerResultsLog & Results, TArray * ObjLoaded) Line 125	C++
 	UE4Editor-KismetCompiler.dll!FKismet2CompilerModule::CompileBlueprint(UBlueprint * Blueprint, const FKismetCompilerOptions & CompileOptions, FCompilerResultsLog & Results, FBlueprintCompileReinstancer * ParentReinstancer, TArray * ObjLoaded) Line 159	C++
 	UE4Editor-UnrealEd.dll!FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(UBlueprint * Blueprint) Line 1423	C++
 	UE4Editor-BlueprintGraph.dll!FEdGraphSchemaAction_K2NewNode::PerformAction(UEdGraph * ParentGraph, UEdGraphPin * FromPin, const FVector2D Location, bool bSelectNewNode) Line 154	C++
 	UE4Editor-BlueprintGraph.dll!FEdGraphSchemaAction_K2AddEvent::PerformAction(UEdGraph * ParentGraph, UEdGraphPin * FromPin, const FVector2D Location, bool bSelectNewNode) Line 432	C++
 	UE4Editor-BlueprintGraph.dll!FEdGraphSchemaAction_K2NewNode::PerformAction(UEdGraph * ParentGraph, TArray & FromPins, const FVector2D Location, bool bSelectNewNode) Line 187	C++
 	UE4Editor-Kismet.dll!SBlueprintActionMenu::OnActionSelected(const TArray<TSharedPtr,FDefaultAllocator> & SelectedAction) Line 454	C++
 	UE4Editor-Kismet.dll!TBaseSPMethodDelegateInstance_OneParam<SBlueprintActionMenu,void,TArray<TSharedPtr,FDefaultAllocator> const & __ptr64,0>::Execute(const TArray<TSharedPtr,FDefaultAllocator> & InParam1) Line 228	C++
 	UE4Editor-GraphEditor.dll!SGraphActionMenu::HandleSelection(TSharedPtr & InSelectedItem) Line 1151	C++
 	UE4Editor-GraphEditor.dll!SGraphActionMenu::TryToSpawnActiveSuggestion() Line 759	C++
 	UE4Editor-GraphEditor.dll!TBaseSPMethodDelegateInstance_TwoParams::Execute(const FText & InParam1, ETextCommit::Type InParam2) Line 228	C++
 	UE4Editor-GraphEditor.dll!TBaseSPMethodDelegateInstance_TwoParams::ExecuteIfSafe(const FText & InParam1, ETextCommit::Type InParam2) Line 253	C++
 	UE4Editor-Slate.dll!SSearchBox::HandleTextCommitted(const FText & NewText, ETextCommit::Type CommitType) Line 146	C++
 	UE4Editor-Slate.dll!TBaseSPMethodDelegateInstance_TwoParams::Execute(const FText & InParam1, ETextCommit::Type InParam2) Line 228	C++
 	UE4Editor-Slate.dll!TBaseSPMethodDelegateInstance_TwoParams::ExecuteIfSafe(const FText & InParam1, ETextCommit::Type InParam2) Line 253	C++
 	UE4Editor-Slate.dll!SEditableText::OnEnter() Line 837	C++
 	UE4Editor-Slate.dll!FTextEditHelper::OnKeyDown(const FGeometry & MyGeometry, const FKeyboardEvent & InKeyboardEvent, ITextEditorWidget & TextEditor) Line 163	C++
 	UE4Editor-Slate.dll!SEditableText::OnKeyDown(const FGeometry & MyGeometry, const FKeyboardEvent & InKeyboardEvent) Line 1466	C++
 	UE4Editor-Slate.dll!FSlateApplication::ProcessKeyDownMessage(FKeyboardEvent & InKeyboardEvent) Line 3178	C++
 	UE4Editor-Slate.dll!FSlateApplication::OnKeyDown(const int KeyCode, const unsigned int CharacterCode, const bool IsRepeat) Line 3116	C++
 	UE4Editor-Core.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 1044	C++
 	UE4Editor-Core.dll!FWindowsApplication::DeferMessage(TSharedPtr & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 1479	C++
 	UE4Editor-Core.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 595	C++
 	UE4Editor-Core.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 461	C++
 	[External Code]	
 	UE4Editor-Core.dll!FWindowsPlatformMisc::PumpMessages(bool bFromMainLoop) Line 523	C++
 	UE4Editor.exe!FEngineLoop::Tick() Line 2073	C++
 	UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 132	C++
 	UE4Editor.exe!GuardedMainWrapper(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 125	C++
 	UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 207	C++
 	[External Code]	

The ensure that’s failing is in KismetCompiler.cpp:1445:

ensure((Function->FunctionFlags & FUNC_FuncOverrideMatch) == (OverridenFunction->FunctionFlags & FUNC_FuncOverrideMatch));

When I changed the event declaration to be protected instead of private, the crashdump stopped happening. Obviously this is user error, though I imagine this scenario should be caught at compile-time.

Also, please note that CrashReportClient.exe was itself crashing for me with this error:

To fix this, I followed the steps from this AnswerHub question (renaming dbghelp.dll to dbghelp_.dll):

Please let me know if you need any further information. Thanks!

Well obviously it crashes because blueprint interpreter can’t override private function to detect function calls to raise event in blueprint. The thing which should throw out error here is UHT during header file generation.

Hello,

Thank you for your report. We were not able to investigate this on the engine version you reported, but there have been many version changes to UE4 since this question was first posted. With a new version of the Engine comes new fixes and it is possible that this issue has changed or may no longer occur. Due to timetable of when this issue was first posted, we are marking this post as resolved for tracking purposes.

If you are still experiencing the issue you reported in the current engine version, then please respond to this message with additional information and we will investigate as soon as possible. If you are experiencing a similar, but different issue at this time, please submit a new report for it.

Thank you.