Description

A user has reported a crash that is reproducable in a clean project in UE 5.1.0 release. It involves a struct with an instanced object. The crash occurs after deleting a property of that struct type from a blueprint class and recompiling. See repro steps and optionally, the related UDN case where the user provides more context.

I confirmed that I get the crash as well and have attached a repro project targeting UE 5.1.0 so that to repro the crash you only need to perform the last of the repro steps.

Steps to Reproduce

The following repro steps have been confirmed to result in a crash in UE 5.1.0 release. You can skip the initial steps by downloading the attached clean repro project that targets UE 5.1.0.

In C++:

  • Define a UObject class UInstancedObjectSample that is Blueprintable, Abstract, EditInlineNew
  • Define a UStruct FStructWithInstancedObject with instanced UObject property that is Instanced, EditAnywhere
    I.e. paste the following code:
    UCLASS(BlueprintType, Const, Blueprintable, Abstract, EditInlineNew)
    class UInstancedObjectSample : public UObject
    {
       GENERATED_BODY()
    };
     
    USTRUCT(BlueprintType)
    struct FStructWithInstancedObject
    {
       GENERATED_BODY()
    public:
       UPROPERTY(Instanced, EditAnywhere)
       UInstancedObjectSample* InstancedObject;
    };
    

Then in editor:

  • Create a blueprint class deriving from UInstancedObjectSample and name it BP_InstancedObjectImpl
  • Create a blueprint class deriving from ActorComponent and name it BP_TestComponent.
  • Give BP_TestComponent two propertyies of type FStructWithinstancedObject and set its default's object instance to BP_InstancedObjectImpl
  • Create a blueprint class deriving from Character and name it BP_TestCharacter
  • Give BP_TestCharacter two BP_TestComponents
  • Recompile and save all blueprints.

The attached project has been prepared up to here. Launch it and follow the remaining steps.

  • Open BP_TestCharacter
  • Open BP_TestComponent
  • Delete the first FStructWithinstancedObject property from BP_TestComponent
  • Recompile blueprints
  • Observe a crash during recompilation in FObjectPropertyBase::StaticIdentical, PropertyBaseObject.cpp [Line 95] in UE 5.1.0 Release.
  • If it doesn't crash, delete the second FStructWithinstancedObject property from BP_TestComponent
  • Recompile blueprints
  • It should crash now
Callstack

FObjectPropertyBase::StaticIdentical(UObject *,UObject *,unsigned int) PropertyBaseObject.cpp:95
[Inlined] FProperty::Identical_InContainer(const void *,const void *,int,unsigned int) UnrealType.h:458
UScriptStruct::CompareScriptStruct(const void *,const void *,unsigned int) Class.cpp:3048
UStruct::SerializeVersionedTaggedProperties(FStructuredArchiveSlot,unsigned char *,UStruct *,unsigned char *,const UObject *) Class.cpp:1549
UStruct::SerializeTaggedProperties(FStructuredArchiveSlot,unsigned char *,UStruct *,unsigned char *,const UObject *) Class.cpp:1277
UObject::SerializeScriptProperties(FStructuredArchiveSlot) Obj.cpp:1633
UObject::Serialize(FStructuredArchiveRecord) Obj.cpp:1450
UObject::Serialize(FArchive &) Obj.cpp:1338
UActorComponent::Serialize(FArchive &) ActorComponent.cpp:2386
FCPFUOWriter::FCPFUOWriter(UObject *,UObject *,const UEngine::FCopyPropertiesForUnrelatedObjectsParams &) UnrealEngine.cpp:16483
UEngine::CopyPropertiesForUnrelatedObjects(UObject *,UObject *,FCopyPropertiesForUnrelatedObjectsParams) UnrealEngine.cpp:16682
ReplaceObjectHelper(UObject *&,UClass *,UObject *&,UClass *,TMap<UObject *,UObject *,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<UObject *,UObject *,0> > &,TMap<UObject *,FName,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<UObject *,FName,0> > &,int,TArray<UObject *,TSizedDefaultAllocator<32> > &,TArray<UObject *,TSizedDefaultAllocator<32> > &,TSet<AActor *,DefaultKeyFuncs<AActor *,0>,FDefaultSetAllocator> &,TFunctionRef<TArray<USceneComponent *,TSizedDefaultAllocator<32> > & __cdecl(USceneComponent *)>,bool,bool) KismetReinstanceUtilities.cpp:1931
FBlueprintCompileReinstancer::ReplaceInstancesOfClass_Inner(TMap<UClass *,UClass *,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<UClass *,UClass *,0> > &,UObject *,TSet<UObject *,DefaultKeyFuncs<UObject *,0>,FDefaultSetAllocator> *,bool,bool,bool,const TSet<UObject *,DefaultKeyFuncs<UObject *,0>,FDefaultSetAllocator> *,bool) KismetReinstanceUtilities.cpp:2297
FBlueprintCompileReinstancer::BatchReplaceInstancesOfClass(TMap<UClass *,UClass *,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<UClass *,UClass *,0> > &,const FBatchReplaceInstancesOfClassParameters &) KismetReinstanceUtilities.cpp:1621
FBlueprintCompilationManagerImpl::FlushReinstancingQueueImpl() BlueprintCompilationManager.cpp:1794
FBlueprintCompilationManagerImpl::CompileSynchronouslyImpl(const FBPCompileRequestInternal &) BlueprintCompilationManager.cpp:269
FBlueprintCompilationManager::CompileSynchronously(const FBPCompileRequest &) BlueprintCompilationManager.cpp:3292
FKismetEditorUtilities::CompileBlueprint(UBlueprint *,EBlueprintCompileOptions,FCompilerResultsLog *) Kismet2.cpp:763
FBlueprintEditor::Compile() BlueprintEditor.cpp:4058
[Inlined] Invoke(void (FBlueprintEditor::*)(),FBlueprintEditor *&) Invoke.h:66
[Inlined] UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int> >::ApplyAfter(void (FBlueprintEditor::*&)(),FBlueprintEditor *&) Tuple.h:327
TBaseSPMethodDelegateInstance<0,FBlueprintEditor,1,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() DelegateInstancesImpl.h:312
FUICommandList::ExecuteAction(TSharedRef<FUICommandInfo const ,1>) UICommandList.cpp:111
SToolBarButtonBlock::OnClicked() SToolBarButtonBlock.cpp:383
[Inlined] Invoke(FReply (SToolBarButtonBlock::*)(),SToolBarButtonBlock *&) Invoke.h:66
[Inlined] UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int> >::ApplyAfter(FReply (SToolBarButtonBlock::*&)(),SToolBarButtonBlock *&) Tuple.h:327
TBaseSPMethodDelegateInstance<0,SToolBarButtonBlock,1,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() DelegateInstancesImpl.h:295
[Inlined] TDelegate<FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() DelegateSignatureImpl.inl:620
SButton::ExecuteOnClick() SButton.cpp:465
SButton::OnMouseButtonUp(const FGeometry &,const FPointerEvent &) SButton.cpp:390
<lambda_51e270ca99ea7ce852539efd04dd453f>::operator()(const FArrangedWidget &,const FPointerEvent &) SlateApplication.cpp:5046
FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_51e270ca99ea7ce852539efd04dd453f> >(FSlateApplication *,FToLeafmostPolicy,FPointerEvent,const <lambda_51e270ca99ea7ce852539efd04dd453f> &,ESlateDebuggingInputEvent) SlateApplication.cpp:412
FSlateApplication::RoutePointerUpEvent(const FWidgetPath &,const FPointerEvent &) SlateApplication.cpp:5032
FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent &) SlateApplication.cpp:5601
FSlateApplication::OnMouseUp(Type,TVector2<double>) SlateApplication.cpp:5566
FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage &) WindowsApplication.cpp:2219
FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> &,HWND__ *,unsigned int,unsigned long long,long long,int,int,unsigned int) WindowsApplication.cpp:2726
FWindowsApplication::ProcessMessage(HWND__ *,unsigned int,unsigned long long,long long) WindowsApplication.cpp:1895
[Inlined] WindowsApplication_WndProc(HWND__ *,unsigned int,unsigned long long,long long) WindowsApplication.cpp:919
FWindowsApplication::AppWndProc(HWND__ *,unsigned int,unsigned long long,long long) WindowsApplication.cpp:924
<unknown> 0x00007ffe9c93e858
<unknown> 0x00007ffe9c93e4ee
<unknown> 0x00007ffd9a527e59
<unknown> 0x00007ffe696411d8
<unknown> 0x00007ffe9c93e858
<unknown> 0x00007ffe9c93e299
[Inlined] WinPumpMessages() WindowsPlatformApplicationMisc.cpp:113
FWindowsPlatformApplicationMisc::PumpMessages(bool) WindowsPlatformApplicationMisc.cpp:142
FEngineLoop::Tick() LaunchEngineLoop.cpp:5285
[Inlined] EngineTick() Launch.cpp:66
GuardedMain(const wchar_t *) Launch.cpp:204
LaunchWindowsStartup(HINSTANCE__ *,HINSTANCE__ *,char *,int,const wchar_t *) LaunchWindows.cpp:233
WinMain(HINSTANCE__ *,HINSTANCE__ *,char *,int) LaunchWindows.cpp:282
[Inlined] invoke_main() 0x00007ff7882aa516
__scrt_common_main_seh() 0x00007ff7882aa4f5
<unknown> 0x00007ffe9bf77034
<unknown> 0x00007ffe9cc826a1

Have Comments or More Details?

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

2
Login to Vote

Cannot Reproduce
ComponentUE - Gameplay - Blueprint Compiler
Affects Versions5.1
Target Fix5.3
CreatedJan 5, 2023
ResolvedAug 2, 2023
UpdatedAug 3, 2023