Description

If a user creates a specific Blueprint hierarchy with a Blueprint struct, it can cause a issue when the Blueprint struct is being cooked.

User description of Blueprint(s) and Blueprint Struct relationship:

"I create a Blueprint Struct and give it some variables. I create an Actor Component that contains the Struct as a variable. I create two Actors and add that Actor Component to both of them. I create another Actor that only contains a Blueprint Function which copies the Struct from one Actor to another."

Steps to Reproduce
  1. Download attached project and extract
  2. Right click .uproject and generate Visual Studio Project files (make sure association is to a source build 4.13.1)
  3. Open game project .sln
  4. Build game project as Debug and as Debug Editor
  5. Open UE4.sln which is associated with game project
  6. Change to Debug Editor and compile UE4
  7. After compile is done, Right-click UE4 solution and go to properties
  8. Under "Debugging" change "Command Arguments to:
    "<DirectoryTo/Your/GameProject.uproject" -run=cook -cookonthefly -targetplatform=WindowsNoEditor -integrate  -debug 
    
  9. Press Apply and then OK
  10. Use "Local Windows Debugger" button to launch UE4 with new command arguements
  11. When UE4 launches cmd window and says, "Unreal Network File Server is ready for client connections", Open a cmd window and cd to folder that holds game project folder
  12. In new cmd window, run the following command:
    start <GameProjectFolder>/Binaries/Win64/CookCrash-Win64-Debug.exe MyMap -game -filehostip=<your.computer.ip.network-address>
    

RESULT:

Unreal Network File Server will connect with client and begin to package game before hitting a break point in UScriptStruct::InitializeStruct( ).

If not running from Visual Studio, Network File Server will silently crash.

EXPECTED:

Command line cooking completes with no break point or silent crash.

Callstack
UE4Editor-CoreUObject-Win64-Debug.dll!UScriptStruct::InitializeStruct(void * InDest, int ArrayDim) Line 2158	C++
UE4Editor-CoreUObject-Win64-Debug.dll!UStructProperty::InitializeValueInternal(void * InDest) Line 399	C++
UE4Editor-CoreUObject-Win64-Debug.dll!FObjectInitializer::InitNonNativeProperty(UProperty * Property, UObject * Data) Line 1813	C++
UE4Editor-CoreUObject-Win64-Debug.dll!FObjectInitializer::InitProperties(UObject * Obj, UClass * DefaultsClass, UObject * DefaultData, bool bCopyTransientsFromClassDefaults) Line 2982	C++
UE4Editor-CoreUObject-Win64-Debug.dll!FObjectInitializer::PostConstructInit() Line 2718	C++
UE4Editor-CoreUObject-Win64-Debug.dll!FObjectInitializer::~FObjectInitializer() Line 2629	C++
UE4Editor-CoreUObject-Win64-Debug.dll!StaticConstructObject_Internal(UClass * InClass, UObject * InOuter, FName InName, EObjectFlags InFlags, EInternalObjectFlags InternalSetFlags, UObject * InTemplate, bool bCopyTransientsFromClassDefaults, FObjectInstancingGraph * InInstanceGraph) Line 3147	C++
UE4Editor-CoreUObject-Win64-Debug.dll!FLinkerLoad::CreateExport(int Index) Line 4008	C++
UE4Editor-CoreUObject-Win64-Debug.dll!FLinkerLoad::CreateExportAndPreload(int ExportIndex, bool bForcePreload) Line 2876	C++
UE4Editor-CoreUObject-Win64-Debug.dll!FLinkerLoad::LoadAllObjects(bool bForcePreload) Line 3015	C++
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackageInternalInner(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags, FLinkerLoad * ImportLinker, bool bSkipNameChecks) Line 1218	C++
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackageInternal(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags, FLinkerLoad * ImportLinker) Line 1386	C++
UE4Editor-CoreUObject-Win64-Debug.dll!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags) Line 1400	C++
UE4Editor-UnrealEd-Win64-Debug.dll!UCookOnTheFlyServer::TickCookOnTheSide(const float TimeSlice, unsigned int & CookedPackageCount) Line 1566	C++
UE4Editor-UnrealEd-Win64-Debug.dll!UCookCommandlet::CookOnTheFly(FGuid InstanceId, int Timeout, bool bForceClose) Line 411	C++
UE4Editor-UnrealEd-Win64-Debug.dll!UCookCommandlet::Main(const FString & CmdLineParams) Line 824	C++
UE4Editor-Win64-Debug.exe!FEngineLoop::PreInit(const wchar_t * CmdLine) Line 1828	C++
UE4Editor-Win64-Debug.exe!EnginePreInit(const wchar_t * CmdLine) Line 32	C++
UE4Editor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 117	C++
UE4Editor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 191	C++

Have Comments or More Details?

Head over to the existingAnswerHub thread and let us know what's up.

1
Login to Vote

Fixed
ComponentGameplay - Blueprint
Affects Versions4.13.1
Target Fix4.16
Fix Commit3393509
Main Commit3431398
Release Commit3398112
CreatedOct 13, 2016
ResolvedApr 13, 2017
UpdatedMay 12, 2017