The International Simutrans Forum

 

Author Topic: Crashing on load  (Read 683 times)

0 Members and 1 Guest are viewing this topic.

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Crashing on load
« on: November 14, 2018, 05:20:38 PM »
This is a modified save of the server game, where after making Bay Transport go bankrupt, the game crashes; loading the save game just previous to the running crash, also gives a crash with an index out of bounds error.

http://www.mediafire.com/file/u6qwww1j02ms8bq/sessx3.sve/file
By the way, why does it run sluggish in single player, but if I run a server and load the game, it runs at a more normal pace? In single player, there are periods where the frame rate drops drastically and responsiveness lags, but in hosted as a server, this does not occur, though CPU usage is higher.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashing on load
« Reply #1 on: November 14, 2018, 09:46:06 PM »
This saved game appears to be either corrupt or from the wrong pakset - are you sure that this is the correct saved game?

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Crashing on load
« Reply #2 on: November 15, 2018, 03:26:52 AM »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashing on load
« Reply #3 on: November 17, 2018, 01:24:09 PM »
Thank you for uploading that. The saved game is now listed in the list of saved games, indicating that I now have the correct pakset - however, I get a "string longer than allowed size" error on loading, which is a symptom of a corrupt saved game.

Unfortunately, it is not possible to debug corrupt saved games - the only way of finding the problem that caused it is to be able to reproduce reliably the situation in which the saved game became corrupted.

Can you give any details of the circumstances in which this game was saved?
Edit: Can I check, incidentally, that you are getting the same error message as I am getting on loading this saved game?
« Last Edit: November 17, 2018, 02:03:37 PM by jamespetts »

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Crashing on load
« Reply #4 on: November 17, 2018, 07:09:20 PM »
That is indeed the message. I had another save from just prior, but it seems I accidentally overwrote it... I'm sure I was able to load that before without that message... I'll have to see if I can get it to reproduce now from an earlier save.
« Last Edit: November 17, 2018, 07:54:53 PM by Junna »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashing on load
« Reply #5 on: November 17, 2018, 07:51:09 PM »
Splendid, thank you.

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Crashing on load
« Reply #6 on: November 17, 2018, 07:55:07 PM »
http://www.mediafire.com/file/mys97xcslw6v9w6/sessx4-1x2.sve/file
Go to Canal Mouth, which has now been removed by the liquidation, and rebuild the tracks as any company;


Using a elevated viaduct section for the two tile gap, and bridges for the others;
 saving the game after this is done, will result in a broken, corrupted save-game, and if the game runs, it will crash in a short time.
EDIT: It seems related to the invisible viaduct sections over part of the canal that did not disappear when liquidated, though they are not visible. Building viaduct over them and deleting this seems to correct the crashing.
« Last Edit: November 17, 2018, 09:25:34 PM by Junna »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashing on load
« Reply #7 on: November 17, 2018, 11:23:06 PM »
Thank you very much for that: that is most helpful. I think that I have now found and fixed this, and I should be grateful if you could re-test.

The problem was that, when the company was liquidated, ways with no mothballed equivalent (here, the elevated ways) were removed, in this instance, with parts of a convoy still on them. When they were built over again, a cleanup routine was called that deleted the individual vehicles in the convoy meaning that, when the convoy tried to refer to those vehicles, it crashed because it was trying to read memory that had been released.

To fix this, two changes were made: firstly, liquidated companies no longer remove ways for which there are no mothballed equivalents: they are degraded instead. Secondly, the vehicles are no longer removed when the cleanup routine is called, which prevents the crashes in existing saved games.