!TBaseFunctorDelegateInstance and FTimerUnifiedDelegate::Execute() timer crash

Hello I get a weird crash while running my game for 50-60 seconds on both android and PC. It’s more likely to happen on android and especially if I restart level inside my game several times (I have only one level, restart done via GetWorld()->GetFirstPlayerController()->RestartLevel():wink:

This is what I’ve got from debugging in android studio:

art_sigsegv_fault 0x00000071fa813864
art::FaultManager::HandleFault(int, siginfo, void) 0x00000071fa813d68
_lldb_unnamed_symbol24$$app_process64 0x00000056d45a7ec4
<unknown> 0x00000072822a9690
FTimerUnifiedDelegate::Execute() 0x0000007181384740
FTimerManager::Tick(float) 0x00000071813835b4
UWorld::Tick(ELevelTick, float) 0x0000007180c57d20
UGameEngine::Tick(float, bool) 0x0000007180a98c50
FEngineLoop::Tick() 0x000000717cd2f2e0
AndroidMain(android_app) 0x000000717cd28b78
android_main 0x000000717cd357d0
android_app_entry 0x000000717cd5e8f4
pthread_start(void) 0x000000727d63c894
__start_thread 0x000000727d5dab70

This is what I got from Windows (Launch->DESKTOP)

LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: begin: stack for UAT
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: === Critical error: ===
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error:
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: Fatal error!
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error:
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION writing address 0x00003c63
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error:
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d322022e Bloxx.exe!TBaseFunctorDelegateInstance<TTypeWrapper<void> __cdecl(void),<lambda_f27b633392e1e4350259fe39401be23d> >::Execute() [E:\Program Files\Epic Games\UE_4.25\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:944]
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d6cc4572 Bloxx.exe!FTimerUnifiedDelegate::Execute() []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d6d19ec9 Bloxx.exe!FTimerManager::Tick() []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d662e2c9 Bloxx.exe!UWorld::Tick() []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d64955c5 Bloxx.exe!UGameEngine::Tick() []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d26546c0 Bloxx.exe!FEngineLoop::Tick() []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d2666d2c Bloxx.exe!GuardedMain() []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d2666dea Bloxx.exe!GuardedMainWrapper() []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d2678080 Bloxx.exe!WinMain() []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ff6d7d2407e Bloxx.exe!__scrt_common_main_seh() [D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ffa0b347c24 KERNEL32.DLL!UnknownFunction []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: [Callstack] 0x00007ffa0cb4d4d1 ntdll.dll!UnknownFunction []
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error:
LogPlayLevel: Error: [2021.02.09-11.38.55:248][ 40]LogWindows: Error: end: stack for UAT
LogPlayLevel: Error: ERROR: Client exited with error code: 3
LogPlayLevel:        (see C:\Users\myname\AppData\Roaming\Unreal Engine\AutomationTool\Logs\E+Program+Files+Epic+Games+UE_4.25\Log.txt for full exception trace)
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Run Task, Time: 67.890269
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error

Any help will be appreciated, pretty tired from dealing with this crash. :frowning: Sorry if I’m noob at debugging
My specs:
i7 9700k, GTX1070, 16GB RAM;
OnePlus 6;
“EngineAssociation”: “4.25”, I use both BP and cpp

2 Likes

Wrong lambda usage together with FTimerDelegate, switched to

GetWorldTimerManager().SetTimer(MemberTimerHandle, this, &AMyActor::FunctionX, 1.0f, false);

Crashes are now gone

2 Likes