o3de / o3de-multiplayersample

Multiplayer sample project for the Open 3D Engine
https://o3de.org
Other
84 stars 62 forks source link

Crash when launch MultiplayerSample.GameLauncher.exe #141

Closed chenyihaha closed 2 years ago

chenyihaha commented 2 years ago

Describe the bug

Logged at Tue Apr 26 17:23:54 2022 FileVersion: 0.0.0.0 ProductVersion: 0.0.0.0 LogFile: @log@/Game.log ProjectDir: D:\o3de\o3de-multiplayersample Executable: MultiplayerSample.GameLauncher.exe (debug: no Exception Code: 0xC0000005 Exception Addr: 0x0033:0x00007FF93B1AC7D0 Exception Module: Exception Description: EXCEPTION_ACCESS_VIOLATION, Attempt to read from address 0x00000036 The memory could not be "read" Call Stack Trace: 7) 00007FF9F927F67A (KERNELBASE) : UnhandledExceptionFilter 6) 00007FF9FBCC4AF2 (ntdll) : memset 5) 00007FF9FBCAC6D6 (ntdll) : _C_specific_handler 4) 00007FF9FBCC11FF (ntdll) : _chkstk 3) 00007FF9FBC8A289 (ntdll) : RtlRaiseException 2) 00007FF9FBCBFE6E (ntdll) : KiUserExceptionDispatcher 1) D:\o3de\o3de\Gems\Multiplayer\Code\Source\NetworkInput\NetworkInput.cpp (55) : Multiplayer::NetworkInput::GetHostFrameId

Steps to reproduce Steps to reproduce the behavior: build as follow: https://github.com/o3de/o3de-multiplayersample/blob/development/README.md

  1. execute the command : MultiplayerSample.ServerLauncher.exe --console-command-file=server.cfg
  2. execute the command :: MultiplayerSample.GameLauncher.exe --console-command-file=client.cfg
  3. See the crash

Expected behavior work normally

Actual behavior crash

Assets required Provide sample assets needed to reproduce the issue.

Screenshots/Video If applicable, add screenshots and/or a video to help explain your problem.

Found in Branch development

Desktop/Device (please complete the following information):

Additional context Add any other context about the problem here.

chenyihaha commented 2 years ago

### when Running the Server in the Editor , it crash too call stack :

Multiplayer.Editor.dll!Multiplayer::NetworkInput::GetHostFrameId() 行 56 C++ Multiplayer.Editor.dll!Multiplayer::LocalPredictionPlayerInputComponentController::HandleSendClientInputCorrection(AzNetworking::IConnection invokingConnection, const Multiplayer::ClientInputId & inputId, const AzNetworking::ByteBuffer<16384> & correction) 行 386 C++ Multiplayer.Editor.dll!Multiplayer::LocalPredictionPlayerInputComponentBase::HandleRpcMessage(AzNetworking::IConnection invokingConnection, Multiplayer::NetEntityRole remoteRole, Multiplayer::NetworkEntityRpcMessage & message) 行 563 C++ Multiplayer.Editor.dll!Multiplayer::NetBindComponent::HandleRpcMessage(AzNetworking::IConnection invokingConnection, Multiplayer::NetEntityRole remoteRole, Multiplayer::NetworkEntityRpcMessage & message) 行 324 C++ Multiplayer.Editor.dll!Multiplayer::EntityReplicator::HandleRpcMessage(AzNetworking::IConnection invokingConnection, Multiplayer::NetworkEntityRpcMessage & entityRpcMessage) 行 726 C++ Multiplayer.Editor.dll!Multiplayer::EntityReplicationManager::HandleEntityRpcMessage(AzNetworking::IConnection invokingConnection, Multiplayer::NetworkEntityRpcMessage & message) 行 871 C++ [内联框架] Multiplayer.Editor.dll!Multiplayer::MultiplayerSystemComponent::HandleRequest(AzNetworking::IConnection ) 行 720 C++ Multiplayer.Editor.dll!MultiplayerPackets::DispatchPacket(AzNetworking::IConnection connection, const AzNetworking::IPacketHeader & packetHeader, AzNetworking::ISerializer & serializer, Multiplayer::MultiplayerSystemComponent & handler) 行 132 C++ EditorLib.dll!AzNetworking::UdpNetworkInterface::Update(AZ::TimeMs deltaTimeMs) 行 293 C++ EditorLib.dll!AzNetworking::NetworkingSystemComponent::OnTick(float deltaTime, AZ::ScriptTimePoint time) 行 78 C++ [内联框架] EditorLib.dll!AZStd::Internal::INVOKE(void(AZ::TickEvents::)(float, AZ::ScriptTimePoint) &) 行 177 C++ [内联框架] EditorLib.dll!AZStd::invoke(void(AZ::TickEvents::)(float, AZ::ScriptTimePoint) &) 行 55 C++ [内联框架] EditorLib.dll!AZ::EBusEventProcessingPolicy::Call(void(AZ::TickEvents::)(float, AZ::ScriptTimePoint) &) 行 437 C++ EditorLib.dll!AZ::Internal::EBusContainer<AZ::TickEvents,AZ::TickEvents,0,2>::Dispatcher<AZ::EBus<AZ::TickEvents,AZ::TickEvents>>::Broadcast<void (cdecl AZ::TickEvents::)(float,AZ::ScriptTimePoint),float const &,AZ::ScriptTimePoint>(void(AZ::TickEvents::)(float, AZ::ScriptTimePoint) && func, const float & , AZ::ScriptTimePoint && ) 行 1360 C++ EditorLib.dll!AZ::ComponentApplication::Tick() 行 1346 C++ EditorLib.dll!CGameEngine::Update() 行 817 C++ EditorLib.dll!CCryEditApp::IdleProcessing(bool bBackgroundUpdate) 行 2268 C++ EditorLib.dll!CCryEditApp::OnIdle(long lCount) 行 2176 C++ EditorLib.dll!Editor::EditorQtApplication::maybeProcessIdle() 行 312 C++ [外部代码]
EditorLib.dll!CryEditMain(int argc, char argv) 行 3970 C++ [内联框架] Editor.exe!AZStd::Internal::INVOKE(int()(int, char ) &) 行 208 C++ [内联框架] Editor.exe!AZStd::invoke(int()(int, char ) &) 行 55 C++ Editor.exe!main(int argc, char argv) 行 32 C++ Editor.exe!WinMain(HINSTANCE
formal, HINSTANCE formal, char * formal, int __formal) 行 97 C++ [外部代码]

chenyihaha commented 2 years ago

solution:set cl_EnablbeDesyncDebugging false

chenyihaha commented 2 years ago

solution:set cl_EnablbeDesyncDebugging false

error code : const NetworkInput& startReplayInput = m_inputHistory[startReplayIndex];

the crash happens, when startReplayIndex >inputHistorySize