Description

Using bFasterWithoutUnity and MinFilesUsingPrecompiledHeaderOverride, on ShooterGame.Build.Cs results in Engine crash.

Steps to Reproduce

1) Create a C++ ShooterGame project in 4.21.

2) Navigate to your Visual Studio Solution's ShooterGame.Build.CS File, and Add the following to the constructor underneath PrivatePCHHeaderFile = "Public/ShooterGame.h";

bFasterWithoutUnity = true;
MinFilesUsingPrecompiledHeaderOverride = 1;

3) Modify ShooterWeapon.h by adding at the end of the class
public:
FORCEINLINE static bool Test()

{ return false; }

4) Modify ShooterPickup_Ammo.cpp by adding inside the constructor
check(AShooterWeapon::Test());

5) Press F5 in VS to start debugging, which will build everything. When the engine loads, it will fail on the check() as expected

6) Modify JUST ShooterWeapon.h so that now Test returns true
public: FORCEINLINE static bool Test()

{ return true; }

7) Press F5. To build

Result: Crash: Please see Call Stack

Expected: Files that use a header being rebuilt when such header is modified.

Callstack

Assertion failed: AShooterWeapon::Test() [Link Removed] [Line: 10]

UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:417]
UE4Editor_ShooterGame_5667!AShooterPickup_Ammo::AShooterPickup_Ammo() [e:\projects\shootergame\source\shootergame\private\pickups\shooterpickup_ammo.cpp:10]
UE4Editor_HotReload!FHotReloadClassReinstancer::RecreateCDOAndSetupOldClassReinstancing() [d:\build\++ue4\sync\engine\source\developer\hotreload\private\hotreloadclassreinstancer.cpp:247]
UE4Editor_HotReload!FHotReloadClassReinstancer::FHotReloadClassReinstancer() [d:\build\++ue4\sync\engine\source\developer\hotreload\private\hotreloadclassreinstancer.cpp:322]
UE4Editor_HotReload!FHotReloadClassReinstancer::Create() [d:\build\++ue4\sync\engine\source\developer\hotreload\private\hotreloadclassreinstancer.h:120]
UE4Editor_HotReload!FHotReloadModule::ReinstanceClass() [d:\build\++ue4\sync\engine\source\developer\hotreload\private\hotreload.cpp:1255]
UE4Editor_HotReload!FHotReloadModule::ReinstanceClasses() [d:\build\++ue4\sync\engine\source\developer\hotreload\private\hotreload.cpp:1242]
UE4Editor_HotReload!TBaseRawMethodDelegateInstance<0,FHotReloadModule,void __cdecl(void)>::ExecuteIfSafe() [d:\build\++ue4\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:518]
UE4Editor_CoreUObject!UClassReplaceHotReloadClasses() [d:\build\++ue4\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:746]
UE4Editor_CoreUObject!ProcessNewlyLoadedUObjects() [d:\build\++ue4\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:872]
UE4Editor_CoreUObject!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [d:\build\++ue4\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:813]
UE4Editor_Core!TBaseMulticastDelegate<void>::Broadcast() [d:\build\++ue4\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:974]
UE4Editor_Core!FModuleManager::LoadModuleWithFailureReason() [d:\build\++ue4\sync\engine\source\runtime\core\private\modules\modulemanager.cpp:510]
UE4Editor_Core!FModuleManager::LoadModule() [d:\build\++ue4\sync\engine\source\runtime\core\private\modules\modulemanager.cpp:356]
UE4Editor_HotReload!FHotReloadModule::DoHotReloadInternal() [d:\build\++ue4\sync\engine\source\developer\hotreload\private\hotreload.cpp:784]
UE4Editor_HotReload!FHotReloadModule::DoHotReloadFromIDE() [d:\build\++ue4\sync\engine\source\developer\hotreload\private\hotreload.cpp:1515]
UE4Editor_HotReload!FHotReloadModule::Tick() [d:\build\++ue4\sync\engine\source\developer\hotreload\private\hotreload.cpp:1459]
UE4Editor_Core!FTicker::Tick() [d:\build\++ue4\sync\engine\source\runtime\core\private\containers\ticker.cpp:95]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3894]
UE4Editor!GuardedMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launch.cpp:174]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:145]
UE4Editor!WinMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:276]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283]
kernel32

Have Comments or More Details?

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

1
Login to Vote

Won't Fix
ComponentUE - Foundation - Core
Affects Versions4.204.21
CreatedJan 11, 2019
ResolvedAug 27, 2021
UpdatedAug 27, 2021
View Jira Issue