pond3r / ggpo

Good Game, Peace Out Rollback Network SDK
MIT License
3.17k stars 363 forks source link

Player's game crashes when spectator stops spectating them #66

Open ctmatthews opened 2 years ago

ctmatthews commented 2 years ago

This happens 100% of the time for me in both the latest version (commit 7ddadef) and the initial GitHub commit (commit 02b9eff), both in my own game and in the VectorWar sample app.

Repro steps

GGPO Assertion Failed
Assertion: _size != (N-1) @ C:\Dev\ggpobugtest\ggpo-master\src\lib\ggpo\ring_buffer.h:39 (pid:16416)

Here's the call stack I get when running player one in a Debug build:

    VectorWar.exe!Platform::AssertFailed(char * msg) Line 23    C++
>   VectorWar.exe!RingBuffer<GameInput,64>::push(const GameInput & t) Line 39   C++
    VectorWar.exe!UdpProtocol::SendInput(GameInput & input) Line 106    C++
    VectorWar.exe!Peer2PeerBackend::DoPoll(int timeout) Line 139    C++
    VectorWar.exe!Peer2PeerBackend::IncrementFrame() Line 335   C++
    VectorWar.exe!ggpo_advance_frame(GGPOSession * ggpo) Line 139   C++
    VectorWar.exe!VectorWar_AdvanceFrame(int * inputs, int disconnect_flags) Line 351   C++
    VectorWar.exe!VectorWar_RunFrame(HWND__ * hwnd) Line 426    C++
    VectorWar.exe!RunMainLoop(HWND__ * hwnd) Line 84    C++
    VectorWar.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * __formal, wchar_t * __formal, int __formal) Line 181  C++

And here's a video of it:

https://user-images.githubusercontent.com/2348496/144055204-1fa83a06-aa50-4c58-8edf-bb68ee1512cd.mp4