Description

The Functional Test framework crashes when adding a delegate instance if multiplayer PIE is enabled. The crash occurs at the check code in the block below from ..\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl_Variadics.inl:

#if !UE_BUILD_SHIPPING && !UE_BUILD_TEST
		// verify that the same function isn't already bound
		for (IDelegateInstance* DelegateInstance : GetInvocationList())
		{
			if (DelegateInstance != nullptr)
			{
				// this down-cast is OK! allows for managing invocation list in the base class without requiring virtual functions
				TDelegateInstanceInterface* DelegateInstanceInterface = (TDelegateInstanceInterface*)DelegateInstance;
				check(!DelegateInstanceInterface->IsSameFunction(*InDelegateInstance));
			}
		}
#endif
Steps to Reproduce
  1. Create a new map
  2. Open the Level Blueprint
  3. From the Event BeginPlay exec pin, add a Run All Functional Tests node
  4. Compile the level blueprint
  5. Save the map and name it FTest_Crash
  6. Create and open a new Functional Test Blueprint
  7. Create a new Function named TestLogic
  8. Add and connect a Finish Test node
  9. Set Test Result to Succeeded
  10. In the Event Graph, create a new Custom Event named RunTest
  11. From the Event BeginPlay exec pin, add a Bind Event to OnTestStart node
  12. Wire the delegate pin from RunTest to the Bind Event node
  13. From RunTest's exec pin, add a TestLogic node
  14. Compile and save the blueprint
  15. Place the blueprint into the level and save
  16. In the toolbar, open the Play dropdown menu
  17. Set Number of Players to 2.
  18. Open Window > Developer Tools > Session Frontend > Automation
    (If the window was already open, you may need to click Refresh Tests for the map to appear in the list of tests.)
  19. Enable only the Project > Maps > Functional Testing > FTest_Crash test
  20. Click Start Tests

RESULTS: Two game sessions will launch, then crash

Callstack

UE4Editor-FunctionalTesting.dll!TBaseMulticastDelegate<void,bool const >::AddDelegateInstance(IBaseDelegateInstance<void __cdecl(bool)> * InDelegateInstance) Line 1015 C++
UE4Editor-FunctionalTesting.dll!TBaseMulticastDelegate<void,bool const >::AddUObject<UFunctionalTestingManager>(UFunctionalTestingManager * InUserObject, void (bool) * InFunc) Line 733 C++
UE4Editor-FunctionalTesting.dll!UFunctionalTestingManager::RunAllFunctionalTests(UObject * WorldContext, bool bNewLog, bool bRunLooped, bool bInWaitForNavigationBuildFinish, FString ReproString) Line 134 C++
UE4Editor-FunctionalTesting.dll!UFunctionalTestingManager::execRunAllFunctionalTests(FFrame & Stack, void * const Z_Param__Result) Line 20 C++
UE4Editor-CoreUObject.dll!UFunction::Invoke(UObject * Obj, FFrame & Stack, void * const Z_Param__Result) Line 4166 C++
UE4Editor-CoreUObject.dll!UObject::CallFunction(FFrame & Stack, void * const Z_Param__Result, UFunction * Function) Line 484 C++
UE4Editor-CoreUObject.dll!UObject::ProcessContextOpcode(FFrame & Stack, void * const Z_Param__Result, bool bCanFailSilently) Line 1597 C++
UE4Editor-CoreUObject.dll!UObject::execLetBool(FFrame & Stack, void * const Z_Param__Result) Line 1515 C++
UE4Editor-CoreUObject.dll!UObject::ProcessInternal(FFrame & Stack, void * const Z_Param__Result) Line 698 C++
UE4Editor-CoreUObject.dll!UFunction::Invoke(UObject * Obj, FFrame & Stack, void * const Z_Param__Result) Line 4166 C++
UE4Editor-CoreUObject.dll!UObject::ProcessEvent(UFunction * Function, void * Parms) Line 1050 C++
UE4Editor-Engine.dll!AActor::ProcessEvent(UFunction * Function, void * Parameters) Line 520 C++
UE4Editor-Engine.dll!AActor::BeginPlay() Line 2603 C++
UE4Editor-Engine.dll!AWorldSettings::NotifyBeginPlay() Line 132 C++
UE4Editor-Engine.dll!AGameState::OnRep_MatchState() Line 245 C++
UE4Editor-CoreUObject.dll!UFunction::Invoke(UObject * Obj, FFrame & Stack, void * const Z_Param__Result) Line 4166 C++
UE4Editor-CoreUObject.dll!UObject::ProcessEvent(UFunction * Function, void * Parms) Line 1046 C++
UE4Editor-Engine.dll!AActor::ProcessEvent(UFunction * Function, void * Parameters) Line 520 C++
UE4Editor-Engine.dll!FRepLayout::CallRepNotifies(FRepState * RepState, UObject * Object) Line 1550 C++
UE4Editor-Engine.dll!FObjectReplicator::CallRepNotifies(bool bSkipIfChannelHasQueuedBunches) Line 1150 C++
UE4Editor-Engine.dll!FObjectReplicator::PostReceivedBunch() Line 765 C++
UE4Editor-Engine.dll!UActorChannel::ProcessBunch(FInBunch & Bunch) Line 2015 C++
UE4Editor-Engine.dll!UActorChannel::ReceivedBunch(FInBunch & Bunch) Line 1884 C++
UE4Editor-Engine.dll!UChannel::ReceivedSequencedBunch(FInBunch & Bunch) Line 270 C++
UE4Editor-Engine.dll!UChannel::ReceivedNextBunch(FInBunch & Bunch, bool & bOutSkipAck) Line 609 C++
UE4Editor-Engine.dll!UChannel::ReceivedRawBunch(FInBunch & Bunch, bool & bOutSkipAck) Line 354 C++
UE4Editor-Engine.dll!UNetConnection::ReceivedPacket(FBitReader & Reader) Line 1036 C++
UE4Editor-Engine.dll!UNetConnection::ReceivedRawPacket(void * InData, int Count) Line 476 C++
UE4Editor-OnlineSubsystemUtils.dll!UIpNetDriver::TickDispatch(float DeltaTime) Line 174 C++
UE4Editor-Engine.dll!TBaseUObjectMethodDelegateInstance<0,UNetDriver,void __cdecl(float)>::ExecuteIfSafe(float <Params_0>) Line 772 C++
UE4Editor-Engine.dll!TBaseMulticastDelegate<void,float>::Broadcast(float <Params_0>) Line 1043 C++
UE4Editor-Engine.dll!UWorld::Tick(ELevelTick TickType, float DeltaSeconds) Line 1052 C++
UE4Editor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1346 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 364 C++
UE4Editor.exe!FEngineLoop::Tick() Line 2379 C++
UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 142 C++
UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 189 C++
[External Code]

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentUE - Gameplay
Affects Versions4.9
Target Fix4.9
Fix Commit2593297
CreatedJun 18, 2015
ResolvedJun 19, 2015
UpdatedApr 27, 2018