ow-mods/ow-mod-manager

Too Many Logs to the Mod Manager Crashes the Game

Closed this issue · 1 comments

Repro:

  1. Send a lot of log messages (say, 1 every frame)
  2. Wait a bit. The "#" field on the log tab should stop incrementing.
  3. Wait a little more. The game should freeze.
  4. If you close the mod manager, the game will unfreeze.

If I had to guess what's happening:

  1. The mod manager socket somehow stops receiving log message "packets".
  2. The game socket's send buffer fills up because the mod manager socket is no longer receiving.
  3. The game freezes on Socket.Send because it waits for the send buffer to stop being pull so it can send more messages.
  4. 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.

Fixed in 1.6.1 6d771de