News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Crash on loading save game

Started by theongrey, September 05, 2009, 03:24:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

theongrey

I'm using Simutrans 102.0 and pak64 with no addons and a default simutab.conf. This also occurs on the latest svn trunk version.

The game crashes a few seconds after the savegame is loaded. I'm assuming the save got corrupted somehow. Here is the save file: http://dump.xivesoftware.com/big.sve All other save files seem to work and I haven't been able to duplicate the problem.

I tried a little debugging but I'm not familiar with the Simutrans source so I didn't get far. The exception is occuring in planquadrat_t::is_connected in simplan.cc at line 596. Accessing halt_list is throwing an access violation.

I'm not 100% sure this is how it happened, but the steps taken to corrupt the save were roughly:

  • Load the uncorrupted save file and play for a while
  • Save the file over the existing uncorrupted save
  • Save another copy of the game with another (but similar) file name
  • After a few moments, save the file again with the original file name
  • Game crashed at this point. I tried loading both the save file and the copy but both crash a second or two after loading

Bonus info:
I tried loading the corrupted game file and re-saving as XML. The XML file looked ok (although it was too huge for me to properly examine), but it also crashed the game upon loading.

Pausing the game prevents the crash from occurring, but as soon as you un-pause, the crash will occur.

I also attached a log file of console output during one of these crashed game sessions. It doesn't have anything interesting or helpful that I can tell.

Edit: I almost forgot: I'm running Windows 7 RTM x64 on an early 2008 Intel iMac.

z9999

There is a broken passenger packet on Appongfield North stop (388,147).
I don't know why this happened, but you can remove this passenger with removing this stop.

- Load savegame and click pause button
- Remove Appongfield North stop completely
- Rebuild a stop on the same position

This should solve the problem.

theongrey

Should this really crash the game though? I doubt it happens very often (and probably shouldn't happen at all) but if it does I figure a more graceful failure would be a good thing.

I'll try this solution in a while, but it will probably fix the problem.

Dwachs

Quote from: theongrey on September 05, 2009, 06:48:41 PM
Should this really crash the game though? I doubt it happens very often (and probably shouldn't happen at all) but if it does I figure a more graceful failure would be a good thing.
Yes, you are right here.

The cause of the crash is a corrupted passenger-structure, ie passenger that want to travel to a point outside of the map. Nothing that could have been foreseen. The corrupted variable is always set to a valid coordinate. No idea why the bug happens.
Parsley, sage, rosemary, and maggikraut.

prissi

Added check with error message at load time to fix such corrupted games during load time.