Too Many Logs to the Mod Manager Crashes the Game
JohnCorby opened this issue · 0 comments
JohnCorby commented
Repro:
- Send a lot of log messages (say, 1 every frame)
- Wait a bit. The "#" field on the log tab should stop incrementing.
- Wait a little more. The game should freeze.
- If you close the mod manager, the game will unfreeze.
If I had to guess what's happening:
- The mod manager socket somehow stops receiving log message "packets".
- The game socket's send buffer fills up because the mod manager socket is no longer receiving.
- The game freezes on Socket.Send because it waits for the send buffer to stop being pull so it can send more messages.
- When you close the mod manager, a socket disconnect happens, so the game unfreezes because the Socket.Send probably throws an exception saying "ah! can't send anything because the connection was closed!"
I haven't actually looked into the code enough to know the exact details of what does what, but that's what seems to be happening based on how I know sockets work.
IIRC, if you send a different message (so it shows up as a new line instead of incrementing the # counter), the problem doesn't happen. I'm not entirely sure this is actually true, though, but the fact that this bug doesn't happen if you send the logs to the console window (which doesn't have the # functionality) makes me think it's worth pointing out.