GameAnalytics / GA-SDK-CPP

Repository for GameAnalytics C++ SDK.
MIT License
20 stars 16 forks source link

UnrealEngine4 GameAnalytics plugin causes access violation in packaged build during shutdown #68

Closed BonAppetit34 closed 6 years ago

BonAppetit34 commented 6 years ago

Unreal Engine: 4.20.2 GameAnalytics Plugin: v3.0.1 OS/Toolchain: Win 10, VS 2017, Win 10 SDK

Reproduction Steps:

Reproduction Rate: 10 out of 10

Observed Behavior: Debugger reports an access violation Unhandled exception at 0x00007FF771D4AF40 in GameAnalyticsRepro.exe: 0xC0000005: Access violation reading location 0x0000000000000050. with the call-stacks shown below.

Expected Behavior: Packaged build exits without access violation.

Call-Stacks:

ntdll.dll!TppWorkerThread

GameAnalyticsRepro.exe!spdlog::logger::log<>(enum spdlog::level::level_enum,char const *)   C++
GameAnalyticsRepro.exe!gameanalytics::logging::GALogger::d(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &) C++
GameAnalyticsRepro.exe!gameanalytics::threading::GAThreading::thread_routine(void *)    C++
GameAnalyticsRepro.exe!std::_Packaged_state<void * >::_Call_immediate(void) C++
GameAnalyticsRepro.exe!std::_Func_impl<class <lambda_e0b623a606acfd10554dbddbb0c1a7da>,class std::allocator<int>,unsigned char>::_Do_call(void) C++
GameAnalyticsRepro.exe!Concurrency::task<unsigned char>::_InitialTaskHandle<void,class <lambda_1e7ab1498c17d13c4eeec471e7bbfb1a>,struct Concurrency::details::_TypeSelectorNoAsync>::_LogWorkItemAndInvokeUserLambda<class std::function<unsigned char > >(class std::function<unsigned char >) C++
GameAnalyticsRepro.exe!Concurrency::task<unsigned char>::_InitialTaskHandle<void,class <lambda_1e7ab1498c17d13c4eeec471e7bbfb1a>,struct Concurrency::details::_TypeSelectorNoAsync>::_Perform(void) C++
GameAnalyticsRepro.exe!Concurrency::details::_PPLTaskHandle<unsigned char,struct Concurrency::task<unsigned char>::_InitialTaskHandle<void,class <lambda_1e7ab1498c17d13c4eeec471e7bbfb1a>,struct Concurrency::details::_TypeSelectorNoAsync>,struct Concurrency::details::_TaskProcHandle>::invoke(void)   C++
GameAnalyticsRepro.exe!Concurrency::details::_TaskProcHandle::_RunChoreBridge(void *)   C++
GameAnalyticsRepro.exe!Concurrency::details::_DefaultPPLTaskScheduler::_PPLTaskChore::_Callback(void *) C++
msvcp140.dll!Concurrency::details::`anonymous namespace'::_Task_scheduler_callback(_TP_CALLBACK_INSTANCE * _Pci=0x000000df694dfa88, void * _Args=0x0000024ce72f7750, _TP_WORK * __formal=0x000000df694dfa88) Line 158   C++
ntdll.dll!TppWorkpExecuteCallback() Unknown
ntdll.dll!TppWorkerThread() Unknown
kernel32.dll!BaseThreadInitThunk()  Unknown
ntdll.dll!RtlUserThreadStart()  Unknown

Main Thread

ntdll.dll!NtWaitForAlertByThreadId()    Unknown
ntdll.dll!RtlSleepConditionVariableSRW()    Unknown
KernelBase.dll!SleepConditionVariableSRW()  Unknown
msvcp140.dll!__crtSleepConditionVariableSRW(_RTL_CONDITION_VARIABLE * pCond, _RTL_SRWLOCK * pLock, unsigned long dwMs, unsigned long flags) Line 659    C++
[Inline Frame] msvcp140.dll!Concurrency::details::stl_condition_variable_win7::wait_for(Concurrency::details::stl_critical_section_interface *) Line 216    C++
msvcp140.dll!Concurrency::details::stl_condition_variable_win7::wait(Concurrency::details::stl_critical_section_interface * lock) Line 210  C++
msvcp140.dll!do_wait(_Cnd_internal_imp_t * cond=0x0000024ce80d6bb8, _Mtx_internal_imp_t * mtx=0x0000024ce80d6b68, const xtime * target=0x0000000000000000) Line 77  C++
GameAnalyticsRepro.exe!std::_Associated_state<void *>::_Wait(void)  C++
GameAnalyticsRepro.exe!std::_Task_async_state<void *,0>::~_Task_async_state<void *,0>(void) C++
GameAnalyticsRepro.exe!std::_Task_async_state<void *,0>::`vector deleting destructor'(unsigned int) C++
GameAnalyticsRepro.exe!gameanalytics::threading::GAThreading::State::~State(void)   C++
GameAnalyticsRepro.exe!`GASingleton<class gameanalytics::store::GAStore>::getInstanceHolder(void)'::`2'::`dynamic atexit destructor for 'instance_''(void)  C++
ucrtbase.dll!<lambda>(void)()   Unknown
ucrtbase.dll!__crt_seh_guarded_call<int>::operator()<<lambda_7777bce6b2f8c936911f934f8298dc43>,<lambda>(void) & __ptr64,<lambda_3883c3dff614d5e0c5f61bb1ac94921c> >()   Unknown
ucrtbase.dll!_execute_onexit_table()    Unknown
ucrtbase.dll!<lambda>(void)()   Unknown
ucrtbase.dll!__crt_seh_guarded_call<void>::operator()<<lambda_123965863b7b46a3332720573f9ce793>,<lambda>(void) & __ptr64,<lambda_8d528b66de6ae1e796d7f5e3101fca72> >()  Unknown
ucrtbase.dll!common_exit()  Unknown
GameAnalyticsRepro.exe!__scrt_common_main_seh() Line 290    C++
kernel32.dll!BaseThreadInitThunk()  Unknown
ntdll.dll!RtlUserThreadStart()  Unknown
BonAppetit34 commented 6 years ago

Issue still occurs with UE 4.20.2 and GA plugin 3.0.2

the1schwartz commented 6 years ago

Thanks, I am looking into it.

the1schwartz commented 6 years ago

I have just released a new version of the Unreal SDK (3.0.3), you need to download the latest version of the Unreal SDK (https://github.com/GameAnalytics/GA-SDK-UNREAL) as well there is also some fixed in the Unreal files as well. Please let me know if this fixes the issue and so I know if I can close this issue or not.

BonAppetit34 commented 6 years ago

Fix verified. Described issue can not be observed in GA plugin v3.0.3 anymore. Thanks for the quick response.

the1schwartz commented 6 years ago

Great thanks again for reporting this.