Help finding a crash bug
Posted: Thu Jun 30, 2011 5:06 pm
I've been looking at the crash bug described by BillD here:
http://www.neurohack.com/transcendence/ ... =17&t=4335
So far I've seen it reproduce as follows:
1. Use UGWingmen extension (although it is possible, even likely, that it is unrelated, the two cases that I've seen so far both had this extension).
2. Start in Eridani.
3. Go to the next system (call it "Groombridge") and do some stuff.
4. Go back to Eridani and do some stuff.
5. Go back to Groombridge -> CRASH.
If you can try and reproduce the above, I would appreciate it. In particular, I would love to have a consistently reproducible case (I have plenty of save files that crash when you enter the gate, but I need a way to create such a save from scratch).
As far as I can tell here is what is happening:
1. Player starts in Eridani.
2. Player takes the stargate to the next system (call it, "Groombridge"). At this point, the game does a two-phase commit:
2a. First the game moves the player ship from Eridani to Groombridge.
2b. The game saves the Eridani system to disk (which no longer contains the player). But the save is done in such a way that we preserve the previous version of Eridani.
2c. The game saves the Groombridge system (which has the player ship). It then deletes the old version of Eridani.
[Note: 1.06 started doing the above to prevent a game corruption in the event that step 2c failed (e.g., if you ran out of diskspace). In 1.06, if step 2c fail, we would revert the saved Eridani version back to a version before the player entered the gate.]
3. The player now does some stuff in Groombridge and takes the gate back to Eridani. At this point, we do the same two-phase commit:
3a. The game moves the player from Groombridge to Eridani.
3b. The game saves the Groombridge system to disk, preserving the previous version (call it Groombridge version 1).
3c. The game saves the Eridani system and deletes Groombridge version 1.
4. Somehow, the bug happens at either step 3b or 3c.
5. The player now takes the stargate from Eridani to Groombridge. But this time, while loading the Groombridge system from disk, somehow the game loads Groombridge version 1 instead of version 2. Since version 1 is a version of the system before the player left, there is still a copy of the player ship in the system! This means that when the system is loaded, there are two player ships in the system--and since the engine isn't equipped to deal with that, the game crashes. [But the real bug is that somehow we loaded Groombridge version 1 instead of version 2.]
Some speculation and other clues:
Clue 1: There were no disk errors or other issues revealed in the log, so it probably is not an out-of-diskspace issue.
Clue 2: In the cases I've seen, the player also saved the game several times in the middle. Perhaps this causes an interaction with the stargate saving code?
http://www.neurohack.com/transcendence/ ... =17&t=4335
So far I've seen it reproduce as follows:
1. Use UGWingmen extension (although it is possible, even likely, that it is unrelated, the two cases that I've seen so far both had this extension).
2. Start in Eridani.
3. Go to the next system (call it "Groombridge") and do some stuff.
4. Go back to Eridani and do some stuff.
5. Go back to Groombridge -> CRASH.
If you can try and reproduce the above, I would appreciate it. In particular, I would love to have a consistently reproducible case (I have plenty of save files that crash when you enter the gate, but I need a way to create such a save from scratch).
As far as I can tell here is what is happening:
1. Player starts in Eridani.
2. Player takes the stargate to the next system (call it, "Groombridge"). At this point, the game does a two-phase commit:
2a. First the game moves the player ship from Eridani to Groombridge.
2b. The game saves the Eridani system to disk (which no longer contains the player). But the save is done in such a way that we preserve the previous version of Eridani.
2c. The game saves the Groombridge system (which has the player ship). It then deletes the old version of Eridani.
[Note: 1.06 started doing the above to prevent a game corruption in the event that step 2c failed (e.g., if you ran out of diskspace). In 1.06, if step 2c fail, we would revert the saved Eridani version back to a version before the player entered the gate.]
3. The player now does some stuff in Groombridge and takes the gate back to Eridani. At this point, we do the same two-phase commit:
3a. The game moves the player from Groombridge to Eridani.
3b. The game saves the Groombridge system to disk, preserving the previous version (call it Groombridge version 1).
3c. The game saves the Eridani system and deletes Groombridge version 1.
4. Somehow, the bug happens at either step 3b or 3c.
5. The player now takes the stargate from Eridani to Groombridge. But this time, while loading the Groombridge system from disk, somehow the game loads Groombridge version 1 instead of version 2. Since version 1 is a version of the system before the player left, there is still a copy of the player ship in the system! This means that when the system is loaded, there are two player ships in the system--and since the engine isn't equipped to deal with that, the game crashes. [But the real bug is that somehow we loaded Groombridge version 1 instead of version 2.]
Some speculation and other clues:
Clue 1: There were no disk errors or other issues revealed in the log, so it probably is not an out-of-diskspace issue.
Clue 2: In the cases I've seen, the player also saved the game several times in the middle. Perhaps this causes an interaction with the stargate saving code?