Build Type: 4.13 Preview 3 from Launcher
Build version: Version: 4.13.0-3095848+++UE4+Release-4.13
Detailed description of the issue: After hot-reload, UE4 reinstances objects when default values change. During this process, we get warning messages such as this:
LogUObjectGlobals:Warning: Guid referenced by StaticMeshComponent /Game/Test.Test:PersistentLevel.MyActor_1.staticMesh is already used by StaticMeshComponent /Game/Test.Test:PersistentLevel.MyActor_2.staticMesh, which should never happen in the editor but could happen at runtime with duplicate level loading or PIE
We get this warning for each component of each reinstanced object. Every now and then, we also get an error with a callstack. But it doesn’t cause editor to crash.
LogHotReload: New module detected: UE4Editor-SimpleCar1-3314.dll
LogHotReload: Starting Hot-Reload from IDE
LogHotReload: Re-instancing TriggerShape after hot-reload.
LogStats: FPlatformStackWalk::StackWalkAndDump - 3.064 s
LogOutputDevice:Error: === Handled ensure: ===
LogOutputDevice:Error: Ensure condition failed: bArchetypeReinstanced [File:F:\WORK\UnrealEngine\Engine\Source\Editor\UnrealEd\Private\Kismet2\KismetReinstanceUtilities.cpp] [Line: 1556]
LogOutputDevice:Error: Reinstancing non-actor (/Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian10.CapsuleTrigger); failed to resolve archetype object - property values may be lost.
LogOutputDevice:Error: Stack:
LogOutputDevice:Error: UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump() [f:\work\unrealengine\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:183]
LogOutputDevice:Error: UE4Editor-Core.dll!FDebug::EnsureFailed() [f:\work\unrealengine\engine\source\runtime\core\private\misc\outputdevice.cpp:297]
LogOutputDevice:Error: UE4Editor-Core.dll!FDebug::OptionallyLogFormattedEnsureMessageReturningFalse() [f:\work\unrealengine\engine\source\runtime\core\private\misc\outputdevice.cpp:432]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!FBlueprintCompileReinstancer::ReplaceInstancesOfClass_Inner() [f:\work\unrealengine\engine\source\editor\unrealed\private\kismet2\kismetreinstanceutilities.cpp:1556]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!FBlueprintCompileReinstancer::ReplaceInstancesOfClass() [f:\work\unrealengine\engine\source\editor\unrealed\private\kismet2\kismetreinstanceutilities.cpp:1305]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!FBlueprintCompileReinstancer::ReinstanceInner() [f:\work\unrealengine\engine\source\editor\unrealed\private\kismet2\kismetreinstanceutilities.cpp:599]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!FBlueprintCompileReinstancer::ReinstanceObjects() [f:\work\unrealengine\engine\source\editor\unrealed\private\kismet2\kismetreinstanceutilities.cpp:761]
LogOutputDevice:Error: UE4Editor-HotReload.dll!FHotReloadModule::ReinstanceClass() [f:\work\unrealengine\engine\source\developer\hotreload\private\hotreload.cpp:1232]
LogOutputDevice:Error: UE4Editor-HotReload.dll!FHotReloadModule::ReinstanceClasses() [f:\work\unrealengine\engine\source\developer\hotreload\private\hotreload.cpp:1219]
LogOutputDevice:Error: UE4Editor-HotReload.dll!TBaseRawMethodDelegateInstance<0,FHotReloadModule,void __cdecl(void)>::ExecuteIfSafe() [f:\work\unrealengine\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:638]
LogOutputDevice:Error: UE4Editor-CoreUObject.dll!UClassReplaceHotReloadClasses() [f:\work\unrealengine\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:688]
LogOutputDevice:Error: UE4Editor-CoreUObject.dll!ProcessNewlyLoadedUObjects() [f:\work\unrealengine\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:835]
LogOutputDevice:Error: UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [f:\work\unrealengine\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:1017]
LogOutputDevice:Error: UE4Editor-Core.dll!TBaseMulticastDelegate<void>::Broadcast() [f:\work\unrealengine\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:921]
LogOutputDevice:Error: UE4Editor-Core.dll!FModuleManager::LoadModuleWithFailureReason() [f:\work\unrealengine\engine\source\runtime\core\private\modules\modulemanager.cpp:461]
LogOutputDevice:Error: UE4Editor-Core.dll!FModuleManager::LoadModule() [f:\work\unrealengine\engine\source\runtime\core\private\modules\modulemanager.cpp:322]
LogOutputDevice:Error: UE4Editor-HotReload.dll!FHotReloadModule::DoHotReloadInternal() [f:\work\unrealengine\engine\source\developer\hotreload\private\hotreload.cpp:828]
LogOutputDevice:Error: UE4Editor-HotReload.dll!FHotReloadModule::DoHotReloadFromIDE() [f:\work\unrealengine\engine\source\developer\hotreload\private\hotreload.cpp:1453]
LogOutputDevice:Error: UE4Editor-HotReload.dll!FHotReloadModule::Tick() [f:\work\unrealengine\engine\source\developer\hotreload\private\hotreload.cpp:1386]
LogOutputDevice:Error: UE4Editor-Core.dll!FTicker::Tick() [f:\work\unrealengine\engine\source\runtime\core\private\containers\ticker.cpp:79]
LogOutputDevice:Error: UE4Editor.exe!FEngineLoop::Tick() [f:\work\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:2938]
LogOutputDevice:Error: UE4Editor.exe!GuardedMain() [f:\work\unrealengine\engine\source\runtime\launch\private\launch.cpp:156]
LogOutputDevice:Error: UE4Editor.exe!GuardedMainWrapper() [f:\work\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
LogOutputDevice:Error: UE4Editor.exe!WinMain() [f:\work\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
LogOutputDevice:Error: UE4Editor.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
LogOutputDevice:Error: KERNEL32.DLL
LogOutputDevice:Error: ntdll.dll
LogOutputDevice:Error: ntdll.dll
LogStats: SubmitErrorReport - 0.000 s
LogStats: SendNewReport - 0.422 s
LogStats: FDebug::EnsureFailed - 3.489 s
LogUObjectGlobals:Warning: Guid referenced by TriggerShape /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian16.CapsuleTrigger is already used by TriggerShape /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian16.TriggerShape_6, which should never happen in the editor but could happen at runtime with duplicate lev
el loading or PIE
LogUObjectGlobals:Warning: Guid referenced by TriggerShape /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian20.CapsuleTrigger is already used by TriggerShape /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian20.TriggerShape_11, which should never happen in the editor but could happen at runtime with duplicate le
vel loading or PIE
LogHotReload: Re-instancing Pedestrian after hot-reload.
LogUObjectGlobals:Warning: Guid referenced by ArrowComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian16.arrow is already used by ArrowComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian_7.arrow, which should never happen in the editor but could happen at runtime with duplicate level loading or
PIE
LogUObjectGlobals:Warning: Guid referenced by SkeletalMeshComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian16.SkelMesh is already used by SkeletalMeshComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian_7.SkelMesh, which should never happen in the editor but could happen at runtime with duplica
te level loading or PIE
LogUObjectGlobals:Warning: Guid referenced by PedestrianMovementComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian16.PedestrianMovementComp is already used by PedestrianMovementComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian_7.PedestrianMovementComp, which should never happen in the editor
but could happen at runtime with duplicate level loading or PIE
LogUObjectGlobals:Warning: Guid referenced by ArrowComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian20.arrow is already used by ArrowComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian_12.arrow, which should never happen in the editor but could happen at runtime with duplicate level loading or
PIE
LogUObjectGlobals:Warning: Guid referenced by SkeletalMeshComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian20.SkelMesh is already used by SkeletalMeshComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian_12.SkelMesh, which should never happen in the editor but could happen at runtime with duplic
ate level loading or PIE
LogUObjectGlobals:Warning: Guid referenced by PedestrianMovementComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian20.PedestrianMovementComp is already used by PedestrianMovementComponent /Game/Maps/VehicleExampleMap.VehicleExampleMap:PersistentLevel.Pedestrian_12.PedestrianMovementComp, which should never happen in the editor
but could happen at runtime with duplicate level loading or PIE
LogContentBrowser: Native class hierarchy updated for 'SimpleCar1' in 0.0015 seconds. Added 12 classes and 3 folders.
Display: HotReload successful (2 functions remapped 0 scriptstructs remapped)
LogContentBrowser: Native class hierarchy populated in 0.0096 seconds. Added 2168 classes and 436 folders.
Display: HotReload took 4.8s.
However, there is no telling when this occurs, and when it causes data loss. It seems to be happening randomly. Sometimes we add a whitespace in a completely unrelated file and UE4 decides to re-instance our actor class and causes data loss again.
Example code:
UCLASS()
class HOTRELOADTEST_API AMyActor : public AActor
{
GENERATED_BODY()
public:
AMyActor();
UPROPERTY(Category = Rendering, VisibleDefaultsOnly, BlueprintReadOnly)
class UStaticMeshComponent* StaticMesh;
UPROPERTY(EditAnywhere)
int asd = 0;
};
AMyActor::AMyActor()
{
StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("staticMesh"));
RootComponent = StaticMesh;
static ConstructorHelpers::FObjectFinder<UStaticMesh> assetMesh(
TEXT("StaticMesh'/Engine/BasicShapes/Cube.Cube'"));
if (assetMesh.Succeeded()) {
StaticMesh->SetStaticMesh(assetMesh.Object);
}
}
When this actor is placed in the world. Changing the default value of asd member variable causes re-instancing and generated the warning message. However, I couldn’t get crash to occur in this smaller example.
System Specs: Windows 10, 16 GB RAM