I’ve started running into this issue where abilities with certain custom tasks added will crash UE4 when activated. It’s a nullptr error. One of my team’s engineers thinks it might be data corruption, because my custom tasks were not doing this one changelist previous and there were no changes to the custom tasks between those two CLs. The error I see says"Cast of nullptr to AblAbilityTaskScratchPad failed".
The weird thing is that if I open an ability that causes a crash and resave it, it no longer crashes the engine until I revert the file in source control or check it in. Here’s a callstack he provided me:
I’m using the latest Able version and UE4 version 4.24.3
log
UE4Editor-Engine.dll!FTickFunctionTask::DoTask(ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 285 C++
[5:54](https://whitemoondreams.slack.com/archives/DC17CPQ90/p1589849674022900)
here is the call stack:
[Inline Frame] UE4Editor-CoreUObject.dll!CastLogError::__l11::<lambda_85a69443e79372a632c30a14da020d5f>::operator()() Line 10 C++
UE4Editor-CoreUObject.dll!CastLogError(const wchar_t * FromType, const wchar_t * ToType) Line 10 C++
[Inline Frame] UE4Editor-AbleCore.dll!CastChecked(UAblCustomTaskScratchPad * Src) Line 213 C++
UE4Editor-AbleCore.dll!UAblCustomTask::CreateScratchPad(const TWeakObjectPtr<UAblAbilityContext,FWeakObjectPtr> & Context) Line 73 C++
UE4Editor-AbleCore.dll!UAblAbilityContext::AllocateScratchPads() Line 101 C++
UE4Editor-AbleCore.dll!UAblAbilityComponent::InternalStartAbility(UAblAbilityContext * Context, bool ServerActivatedAbility) Line 1054 C++
UE4Editor-AbleCore.dll!UAblAbilityComponent::HandlePendingContexts() Line 1186 C++
UE4Editor-AbleCore.dll!UAblAbilityComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction) Line 168 C++
> [Inline Frame] UE4Editor-Engine.dll!FActorComponentTickFunction::ExecuteTick::__l2::<lambda_8b87dc54ce1db8ca3e3fdcfa35a4582b>::operator()(float) Line 892 C++
UE4Editor-Engine.dll!FActorComponentTickFunction::ExecuteTickHelper<<lambda_8b87dc54ce1db8ca3e3fdcfa35a4582b> >(UActorComponent * Target, bool bTickInEditor, float DeltaTime, ELevelTick TickType, const FActorComponentTickFunction::ExecuteTick::__l2::<lambda_8b87dc54ce1db8ca3e3fdcfa35a4582b> & ExecuteTickFunc) Line 3388 C++
UE4Editor-Engine.dll!FActorComponentTickFunction::ExecuteTick(float DeltaTime, ELevelTick TickType, ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 894 C++
UE4Editor-Engine.dll!FTickFunctionTask::DoTask(ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 285 C++
UE4Editor-Engine.dll!TGraphTask<FTickFunctionTask>::ExecuteTask(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32> > & NewTasks, ENamedThreads::Type CurrentThread) Line 847 C++
[Inline Frame] UE4Editor-Core.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32> > & CurrentThread, ENamedThreads::Type) Line 514 C++
UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 686 C++
UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksUntilIdle(int QueueIndex) Line 594 C++
UE4Editor-Engine.dll!FTickTaskSequencer::ReleaseTickGroup(ETickingGroup WorldTickGroup, bool bBlockTillComplete) Line 577 C++
UE4Editor-Engine.dll!FTickTaskManager::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 1528 C++
UE4Editor-Engine.dll!UWorld::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 782 C++
UE4Editor-Engine.dll!UWorld::Tick(ELevelTick TickType, float DeltaSeconds) Line 1567 C++
UE4Editor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1683 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 410 C++
UE4Editor.exe!FEngineLoop::Tick() Line 4485 C++
[Inline Frame] UE4Editor.exe!EngineTick() Line 62 C++
UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 173 C++
UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 252 C++
[External Code]
The moment this started to happen was when I created a new ability, new custom task specifically for that ability, and a scratchpad for that custom task. At some point I made some changes to everything and other abilities without that custom task started to fail. The only common link was this particular ability had a custom task that the other abilities used.
here’s the log on my end:
[2020.05.19-21.11.35:838][161]LogWindows: Error: === Critical error: ===
[2020.05.19-21.11.35:838][161]LogWindows: Error:
[2020.05.19-21.11.35:838][161]LogWindows: Error: Fatal error: [File:D:/WDI/Acn/UE4/Engine/Source/Runtime/CoreUObject/Private/Templates/Casts.cpp] [Line: 10]
[2020.05.19-21.11.35:838][161]LogWindows: Error: Cast of nullptr to AblAbilityTaskScratchPad failed
[2020.05.19-21.11.35:838][161]LogWindows: Error:
[2020.05.19-21.11.35:838][161]LogWindows: Error:
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff63f0a799 KERNELBASE.dll!UnknownFunction ]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff0851df56 UE4Editor-Core.dll!ReportAssert() [d:\wdi\acn\ue4\engine\source\runtime\core\private\windows\windowsplatformcrashcontext.cpp:1341]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff08520db1 UE4Editor-Core.dll!FWindowsErrorOutputDevice::Serialize() [d:\wdi\acn\ue4\engine\source\runtime\core\private\windows\windowserroroutputdevice.cpp:79]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff0830449d UE4Editor-Core.dll!FOutputDevice::LogfImpl() [d:\wdi\acn\ue4\engine\source\runtime\core\private\misc\outputdevice.cpp:71]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff06b3e363 UE4Editor-CoreUObject.dll!CastLogError() [d:\wdi\acn\ue4\engine\source\runtime\coreuobject\private emplates\casts.cpp:11]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ffee615ec14 UE4Editor-AbleCore.dll!UAblCustomTask::CreateScratchPad() [d:\wdi\acn\ue4\engine\plugins\able\source\ablecore\private asks\ablcustomtask.cpp:73]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ffee6157c20 UE4Editor-AbleCore.dll!UAblAbilityContext::AllocateScratchPads() [d:\wdi\acn\ue4\engine\plugins\able\source\ablecore\private\ablabilitycontext.cpp:101]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ffee6184d74 UE4Editor-AbleCore.dll!UAblAbilityComponent::InternalStartAbility() [d:\wdi\acn\ue4\engine\plugins\able\source\ablecore\private\ablabilitycomponent.cpp:1054]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ffee61827dd UE4Editor-AbleCore.dll!UAblAbilityComponent::HandlePendingContexts() [d:\wdi\acn\ue4\engine\plugins\able\source\ablecore\private\ablabilitycomponent.cpp:1186]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ffee61ada39 UE4Editor-AbleCore.dll!UAblAbilityComponent::TickComponent() [d:\wdi\acn\ue4\engine\plugins\able\source\ablecore\private\ablabilitycomponent.cpp:168]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff04091588 UE4Editor-Engine.dll!FActorComponentTickFunction::ExecuteTickHelper<<lambda_b80b67805432a32119ae0b418e9a4616> >() [d:\wdi\acn\ue4\engine\source\runtime\engine\classes\gameframework\actor.h:3388]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff040c2534 UE4Editor-Engine.dll!FActorComponentTickFunction::ExecuteTick() [d:\wdi\acn\ue4\engine\source\runtime\engine\private\components\actorcomponent.cpp:894]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff04e372e3 UE4Editor-Engine.dll!FTickFunctionTask::DoTask() [d:\wdi\acn\ue4\engine\source\runtime\engine\private icktaskmanager.cpp:285]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff04e45316 UE4Editor-Engine.dll!TGraphTask<FTickFunctionTask>::ExecuteTask() [d:\wdi\acn\ue4\engine\source\runtime\core\public\async askgraphinterfaces.h:847]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff080ca152 UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread() [d:\wdi\acn\ue4\engine\source\runtime\core\private\async askgraph.cpp:686]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff080ca40a UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksUntilIdle() [d:\wdi\acn\ue4\engine\source\runtime\core\private\async askgraph.cpp:594]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff04e6376d UE4Editor-Engine.dll!FTickTaskSequencer::ReleaseTickGroup() [d:\wdi\acn\ue4\engine\source\runtime\engine\private icktaskmanager.cpp:577]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff04e69882 UE4Editor-Engine.dll!FTickTaskManager::RunTickGroup() [d:\wdi\acn\ue4\engine\source\runtime\engine\private icktaskmanager.cpp:1528]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff045e9a1f UE4Editor-Engine.dll!UWorld::RunTickGroup() [d:\wdi\acn\ue4\engine\source\runtime\engine\private\leveltick.cpp:782]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff045f50ce UE4Editor-Engine.dll!UWorld::Tick() [d:\wdi\acn\ue4\engine\source\runtime\engine\private\leveltick.cpp:1567]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff01dcae90 UE4Editor-UnrealEd.dll!UEditorEngine::Tick() [d:\wdi\acn\ue4\engine\source\editor\unrealed\private\editorengine.cpp:1683]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff02632576 UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick() [d:\wdi\acn\ue4\engine\source\editor\unrealed\private\unrealedengine.cpp:410]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ff62c267f62 UE4Editor.exe!FEngineLoop::Tick() [d:\wdi\acn\ue4\engine\source\runtime\launch\private\launchengineloop.cpp:4485]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ff62c27c3ec UE4Editor.exe!GuardedMain() [d:\wdi\acn\ue4\engine\source\runtime\launch\private\launch.cpp:173]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ff62c27c4ca UE4Editor.exe!GuardedMainWrapper() [d:\wdi\acn\ue4\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ff62c28ceae UE4Editor.exe!WinMain() [d:\wdi\acn\ue4\engine\source\runtime\launch\private\windows\launchwindows.cpp:263]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007ff62c28fcbe UE4Editor.exe!__scrt_common_main_seh() [d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff64bd7bd4 KERNEL32.DLL!UnknownFunction ]
[2020.05.19-21.11.35:838][161]LogWindows: Error: [Callstack] 0x00007fff661cce51 ntdll.dll!UnknownFunction ]