Page 1 of 1

[0.11.8-MP] Crash when connecting machines to the grid

Posted: Sat Dec 27, 2014 6:46 pm
by teozkr
A few hours into my and a friend's first multiplayer game (two people in total) the game crashed when he connected yet another Chemical Plant to our power grid. We started investigating the issue, since we already had several plants running fine, and it turned out that connecting any machine to the power grid would cause the game to crash.

Steps to reproduce:

1. Run Factorio on two computers, both on Linux (no idea about other OSes)
2. Load OTHERKINKIN as a multiplayer game on one of the computers
3. Connect from the other computer
4. Connect a building to the power grid

Expected result:
Building is connected to power grid

Actual result:
Game crashes (log)

Other notes:
  • You can swap step 3 and 4 around, and the game will still crash, but only once both conditions are fulfilled
  • The crash doesn't happen in singleplayer (or when there is only one player in-game), but it will then instead crash when trying to leave the game
  • Re-saving the game works fine but doesn't fix the issue

Re: [0.11.8-MP] Crash when connecting machines to the grid

Posted: Sun Dec 28, 2014 3:39 pm
by kovarex
Is it possible, that you saved the game in 0.11.7 before? If so the save game would be corrupted internally.

Re: [0.11.8-MP] Crash when connecting machines to the grid

Posted: Sun Dec 28, 2014 3:45 pm
by teozkr
kovarex wrote:Is it possible, that you saved the game in 0.11.7 before? If so the save game would be corrupted internally.
Nope, I bought the game the same day that I made the post, and we started the game fresh; playing with no issues for a couple of hours (5-6?) before this happened. My install was updated in-place 0.10.12 demo -> 0.10.12 alpha -> 0.11.8 alpha. I'm not 100% sure, but I believe his install was a fresh 0.11.8 alpha.

Re: [0.11.8-MP] Crash when connecting machines to the grid

Posted: Mon Dec 29, 2014 12:33 pm
by kovarex
Ok, so this bug was more complicated then I expected, but after 2 days of debugging and investigation I was able to find the cause of this problem.
The very root of the problem is in the parallel saving introduced in 0.11.6. The game didn't handle well when the electric pole was viewed (or selected) while the game was saved. The result was double saving of some of the entities (inserter in the case of your save), which can lead to various type of problems, but this is one of them.

So I fixed the problem for 0.11.9, and I also made a special piece of code that removes the invalid double entities connected to the electric network, so now when I load your save it works correctly. We plan to make the release around 2.1. 2015.

Thanks for the report and for the save, so I was able to find and fix the problem.

Re: [0.11.8-MP] Crash when connecting machines to the grid

Posted: Mon Dec 29, 2014 3:04 pm
by teozkr
Great, thanks! :D