PopcornFX / O3DEPopcornFXPlugin

PopcornFX plugin for O3DE
https://www.popcornfx.com/
Other
13 stars 12 forks source link

PopcornFX.dll Crash on Shutdown #74

Open AMZN-Gene opened 6 months ago

AMZN-Gene commented 6 months ago

Steps to Repro

  1. Open Multiplayer.sln
  2. Run MultiplayerSample GameLauncher in the debugger (profile mode is fine)
  3. Open console (~ key) and "quit"

Expected Results MultiplayerSample.GameLauncher shuts downs without crashing

Actual Results App crashes inside the PopcornFX.dll when trying to release an environment variable

    PopcornFX.dll!AZStd::pair<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>,AZStd::function<void __cdecl(AZ::ReflectContext *)>>::~pair<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>,AZStd::function<void __cdecl(AZ::ReflectContext *)>>()    C++
    PopcornFX.dll!AZStd::Internal::hash_table_storage<AZStd::Internal::UnorderedMapTableTraits<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>,AZStd::function<void __cdecl(AZ::ReflectContext *)>,AZStd::hash<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>>,AZStd::equal_to<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>>,AZStd::allocator,0>,1>::~hash_table_storage<AZStd::Internal::UnorderedMapTableTraits<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>,AZStd::function<void __cdecl(AZ::ReflectContext *)>,AZStd::hash<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>>,AZStd::equal_to<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>>,AZStd::allocator,0>,1>()    C++
>   PopcornFX.dll!AZ::Internal::EnvironmentVariableHolder<ScriptCanvasModel>::DestructDispatchNoLock(AZ::Internal::EnvironmentVariableHolderBase * base, AZ::Internal::EnvironmentVariableHolderBase::DestroyTarget selfDestruct) Line 254  C++
    O3DEKernel.dll!AZ::Internal::EnvironmentVariableHolderBase::UnregisterAndDestroy(void(*)(AZ::Internal::EnvironmentVariableHolderBase *, AZ::Internal::EnvironmentVariableHolderBase::DestroyTarget) destruct, bool moduleRelease) Line 102  C++
    [External Code] 
    MultiplayerSample.GameLauncher.exe!AZ::DynamicModuleHandleWindows::UnloadModule() Line 142  C++
    MultiplayerSample.GameLauncher.exe!AZ::DynamicModuleHandle::Unload() Line 90    C++
    [External Code] 
    [Inline Frame] MultiplayerSample.GameLauncher.exe!AZStd::Internal::sp_counted_base::release() Line 87   C++
    [Inline Frame] MultiplayerSample.GameLauncher.exe!AZStd::Internal::shared_count::{dtor}() Line 289  C++
    [Inline Frame] MultiplayerSample.GameLauncher.exe!AZStd::Internal::destroy<AZStd::shared_ptr<AZ::ModuleDataImpl> *,AZStd::shared_ptr<AZ::ModuleDataImpl>,0>::single(AZStd::shared_ptr<AZ::ModuleDataImpl> *) Line 68    C++
    [Inline Frame] MultiplayerSample.GameLauncher.exe!AZStd::vector<AZStd::shared_ptr<AZ::ModuleDataImpl>,AZStd::allocator>::pop_back() Line 580    C++
    MultiplayerSample.GameLauncher.exe!AZ::ModuleManager::UnloadModules() Line 263  C++
    MultiplayerSample.GameLauncher.exe!AZ::ComponentApplication::Destroy() Line 1042    C++
    MultiplayerSample.GameLauncher.exe!AzFramework::Application::Stop() Line 285    C++
    MultiplayerSample.GameLauncher.exe!O3DELauncher::Run(const O3DELauncher::PlatformMainInfo & mainInfo) Line 638  C++
    MultiplayerSample.GameLauncher.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 41    C++
ValPKFX commented 6 months ago

This seems to come from custom script canvas nodes. I tried to remove the one we have in the plugin (Code/Source/ScriptCanvas) but it then crash here:

    Multiplayer_ScriptCanvas.dll!AZStd::pair<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>,AZStd::function<void __cdecl(AZ::ReflectContext *)>>::~pair<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>,AZStd::function<void __cdecl(AZ::ReflectContext *)>>() C++
    Multiplayer_ScriptCanvas.dll!AZStd::Internal::hash_table_storage<AZStd::Internal::UnorderedMapTableTraits<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>,AZStd::function<void __cdecl(AZ::ReflectContext *)>,AZStd::hash<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>>,AZStd::equal_to<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>>,AZStd::allocator,0>,1>::~hash_table_storage<AZStd::Internal::UnorderedMapTableTraits<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>,AZStd::function<void __cdecl(AZ::ReflectContext *)>,AZStd::hash<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>>,AZStd::equal_to<AZStd::basic_string<char,AZStd::char_traits<char>,AZStd::allocator>>,AZStd::allocator,0>,1>() C++
>   Multiplayer_ScriptCanvas.dll!AZ::Internal::EnvironmentVariableHolder<ScriptCanvasModel>::DestructDispatchNoLock(AZ::Internal::EnvironmentVariableHolderBase * base, AZ::Internal::EnvironmentVariableHolderBase::DestroyTarget selfDestruct) Line 254   C++
    O3DEKernel.dll!AZ::Internal::EnvironmentVariableHolderBase::UnregisterAndDestroy(void(*)(AZ::Internal::EnvironmentVariableHolderBase *, AZ::Internal::EnvironmentVariableHolderBase::DestroyTarget) destruct, bool moduleRelease) Line 102  C++
    [External Code] 
    MultiplayerSample.GameLauncher.exe!AZ::DynamicModuleHandleWindows::UnloadModule() Line 142  C++
    MultiplayerSample.GameLauncher.exe!AZ::DynamicModuleHandle::Unload() Line 90    C++
    [External Code] 
    [Inline Frame] MultiplayerSample.GameLauncher.exe!AZStd::Internal::sp_counted_base::release() Line 87   C++
    [Inline Frame] MultiplayerSample.GameLauncher.exe!AZStd::Internal::shared_count::{dtor}() Line 289  C++
    [Inline Frame] MultiplayerSample.GameLauncher.exe!AZStd::Internal::destroy<AZStd::shared_ptr<AZ::ModuleDataImpl> *,AZStd::shared_ptr<AZ::ModuleDataImpl>,0>::single(AZStd::shared_ptr<AZ::ModuleDataImpl> *) Line 68    C++
    [Inline Frame] MultiplayerSample.GameLauncher.exe!AZStd::vector<AZStd::shared_ptr<AZ::ModuleDataImpl>,AZStd::allocator>::pop_back() Line 580    C++
    MultiplayerSample.GameLauncher.exe!AZ::ModuleManager::UnloadModules() Line 263  C++
    MultiplayerSample.GameLauncher.exe!AZ::ComponentApplication::Destroy() Line 1042    C++
    MultiplayerSample.GameLauncher.exe!AzFramework::Application::Stop() Line 285    C++
    MultiplayerSample.GameLauncher.exe!O3DELauncher::Run(const O3DELauncher::PlatformMainInfo & mainInfo) Line 638  C++
    MultiplayerSample.GameLauncher.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 41    C++
    [External Code] 

So it looks like the crash happens with all custom script canvas nodes and is not something done incorrectly in the plugin.

AMZN-Gene commented 6 months ago

Thanks for investigating! I’ll have to poke around in script canvas :)