SourMesen / Mesen

Mesen is a cross-platform (Windows & Linux) NES/Famicom emulator built in C++ and C#
https://www.mesen.ca
GNU General Public License v3.0
1.26k stars 320 forks source link

Random crashes when loading save state during netplay #811

Open properchopsticks opened 4 years ago

properchopsticks commented 4 years ago

hi,

i've done some more testing with the 0.9.9.31 build and it runs very smoothly with little to no lag at all.

i noticed that using save states during netplay causes random crashes for the client. more specifically, a friend of mine made a server as the host and i connected as the client. during gameplay he made several save states where he would load from if we died or got stuck. normally loading from a save state works fine but every now and then it cause my mesen to crash. it runs fine on the host side but causes the client's app to crash. (not disconnect rather crashes the application)

i did a stress test with a virtual machine where i made a save state and loaded it a couple of dozen times but i couldn't make the client app to crash this time, neither the host app. the game tested was battletoads (usa version) both in the stress test and in the normal gameplay.

host and client both use windows 10 with mesen 0.9.9.31 build.

also just wanted to comment on how smooth and painless is to connect to the netplay server after a crash, just connect back to the server and you're done. no restarting or reloading the game. very beautifully implemented. :)

thank you

SourMesen commented 4 years ago

Thanks for the report! I'll try to reproduce this on my end and see if I can find the cause.

properchopsticks commented 4 years ago

hi,

i wanted to post an update. i did a couple of network captures while playing on netplay and i noticed that every time before it would crash it would receive a bunch of packets from the host using reassembledTCP protocol and then it would try to send 1 packet using normal TCP and then it would crash. that was the case for 2 of the captures, the third it was able to receive packets after sending the TCP packet but then it also crashed.

here are the screenshots of the captures: session 1 session 2 session 3

hope this helps

ghost commented 4 years ago

I had somehow same experience today with some friends (on Mesen-S dev 0.4.0.29) with Super Bomberman 4 (J), we were 3 (Me as server), they both crashed at the same time, while also one of them mentioned that he suddenly was controlling my player (after the crash was gone I think due to connection ?). Well it's a weird explanation but just wanted to share. I would like to suggest a chat/display ping in ms for each player, also if it's possible for the server to choose to disable using cheats.