News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

[R7373] Crash on Loading saves

Started by LNBC, November 27, 2014, 10:21:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LNBC

The bug is discovered after an upgrading from R5583 (V111.2) to R7373 (V120.1)
[Using Pak128 v 2.5.2 when this situation happens.]

In short, it is unable to Load game after starting the application,
and it HANGS just after pressing the "LOAD GAME" button.
(Windows pop-out: Simutrans stops working.)

More, it is funny that after deleting "_cached.xml" file in my save folder,
Everything goes back to normal again.

It sounded alike a program error that never being reported,
so that's why I am typing the development team what's going wrong.

PS Coming soon: The Laughing Man.

prissi

That sounds rather like a corrupted _cache.xml which did happen before.

Maybe SImutrans should rename it before open it so future attempts will just rebuilt that file.

Ters

What Simutrans should do is detect that the file is corrupted and stop reading from it, rather than crash. The cache file can then be regenerated when Simutrans falls back to reading the save games. If someone has enough time to spare.

prissi

Due to the way of the xml reader it cannot fail gracefully but can only fail with a fatal exception (whithout a lot of hacking around).

As for now I will just make sure this does not repeat itself, i.e. first a file "_load_cached.xml" is deleted, then "_cache.xml" is renamed to "_loade_cached.xml", then after succesful loading it is renamed back.

Ters

Quote from: prissi on November 27, 2014, 09:34:35 PM
Due to the way of the xml reader it cannot fail gracefully but can only fail with a fatal exception (whithout a lot of hacking around).

I acknowledged that it wan't easy. Where is the xml reader anyway?

prissi

THe xml read make it tags by automtic construction/destruction of variable. A block starts with xml_tag_t("bla") which trys to find <bla> If it cannot find it (file corrupt), then the constructor fails. One could encapsulate each constructor with try but then the file reading is multithreaded ...