News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

(#514be03) crash just after loading a save game

Started by Phystam, May 31, 2021, 09:21:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Phystam

Hi,
I don't know whether it is a related issue: https://forum.simutrans.com/index.php/topic,20926.0.html
I loaded an old save game which was saved before incorporation of PJMack's improvement patch, and saved it with the latest version. (#514be03)
Just after loading the new save game, the game showed a fatal error and crashed.


Try this: https://www.dropbox.com/s/w0qpuch1jp5zvgh/PHNS-Karafuto-2nd3.sve?dl=0



I misplaced this report on the wrong board. Can someone move this to "not closed" bug report? <- I could.  forget this~~

Phystam

double post!
I updated the pakset and the Extended(#51a0f3c), then it works fine for a while. But after some time, I got another crash without a fatal error.
I made a save game that can reproduce the crash just after loading: https://www.dropbox.com/s/theul150908c9bo/PHNS-Karafuto-2nd6.sve?dl=0

GDB shows this message. Probably divided by zero or something?

PJMack

And this is another embarrassing mistake I have to apologize for...  I submitted a crash prevention fix.

What is happening is that during congestion percentage calculation, the combined_actual multiplied by 100u is greater than 2^32 resulting in an overflow and resulting in 2^32-100.  This, upon conversion to sint32 results in -100, hence the division by zero.  The fast fix was to ignore any congestion percentages less than zero.

Phystam