UObject() constructor called.. crash at startup

I’m getting this error about 70% of opening project. I’m unable to figure out what might be wrong. Nearly fresh project, double checked I’m not creating any actors or uobjects in non standard way. Any pointers to what might be wrong are more than welcome! :slight_smile:

Note: I get exactly same error even after updating engine from GitHub source. Release branch. so this si for 4.12.5 and 4.13 preventing me to work on project. Editor loads up fine. Can I force c++ project to flush all intermediate meta/data or regenerate them all without loosing blueprints (I’m ok with recreating them if it helps tho).

Fatal error: [File:C:\__UE4\UnrealEngine\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 2422] 
UObject() constructor called but it's not the object that's currently being constructed with NewObject. Maybe you trying to construct it on the stack which is not supported.


KERNELBASE.dll
UE4Editor-Core.dll!FOutputDeviceWindowsError::Serialize() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:103]
UE4Editor-Core.dll!FOutputDevice::Logf__VA() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\core\private\misc\outputdevice.cpp:94]
UE4Editor-Core.dll!FDebug::AssertFailed() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\core\private\misc\outputdevice.cpp:421]
UE4Editor-CoreUObject.dll!UObject::UObject() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2423]
UE4Editor-Engine.dll!AActor::AActor() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\engine\private\actor.cpp:50]
UE4Editor-*Edited*.dll
UE4Editor-*Edited*.dll
UE4Editor-CoreUObject.dll!UClass::CreateDefaultObject() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\coreuobject\private\uobject\class.cpp:2524]
UE4Editor-CoreUObject.dll!UObjectLoadAllCompiledInDefaultProperties() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:745]
UE4Editor-CoreUObject.dll!ProcessNewlyLoadedUObjects() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:830]
UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:1017]
UE4Editor-Core.dll!TBaseMulticastDelegate<void>::Broadcast() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:921]
UE4Editor-Core.dll!FModuleManager::LoadModuleWithFailureReason() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\core\private\modules\modulemanager.cpp:461]
UE4Editor-Projects.dll!FModuleDescriptor::LoadModulesForPhase() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\projects\private\moduledescriptor.cpp:398]
UE4Editor-Projects.dll!FProjectManager::LoadModulesForProject() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\projects\private\projectmanager.cpp:53]
UE4Editor.exe!FEngineLoop::LoadStartupModules() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:2218]
UE4Editor.exe!FEngineLoop::PreInit() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:1653]
UE4Editor.exe!GuardedMain() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\launch\private\launch.cpp:117]
UE4Editor.exe!GuardedMainWrapper() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor.exe!WinMain() [c:\__ue4\unrealengine\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:255]
kernel32.dll
ntdll.dll
ntdll.dll

By some coincidence having this in constructor (didn’t noticed it how it get there :expressionless: ) caused this error!

Super::SetActorLabel(TEXT("MyNewShinyErrorLabel"), true); 

Obviously can’t call this during construction from derived class… SOLVED

I have the same problem, I found it was occur because the default object. so I add

if (this->GetFlags() & RF_ClassDefaultObject)
	return;

in my uobjects construct and destruct function,it s ok now

In a subclass of UGameInstanceSubSystem:

  • I had forward declared a subclass of UObject. The CDO logic was crashing. Removed the forward declare and put the include in the header and all is well.