The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: RESTRICTED ACCOUNT on August 20, 2020, 06:14:04 PM

Title: [BUG] Possibility of factory smoke crash
Post by: RESTRICTED ACCOUNT on August 20, 2020, 06:14:04 PM
I was doing a desync check in a loacal environment and the server side crashed, so I quit the client that was alive, loaded the save in a debug build, and after a while, it crashed.

I'm not sure what to report, so I'll paste the image. (´・ω・`)

(https://i.imgur.com/WEwgZhe.png)

(https://i.imgur.com/mbqabrk.png)

(https://i.imgur.com/AOoHbqW.png)

(https://i.imgur.com/SvTIFWY.png)

gr seems to be NULL.

By the way, I did a test in the local environment for a while, but I could not reproduce desync at all.
Title: Re: [BUG] Possibility of factory smoke crash
Post by: jamespetts on August 20, 2020, 06:38:36 PM
Interesting, thank you for this. Can you check what sort of industry it was with a NULL ground? If it was a water industry, the fix should be a simple check to see whether gr is NULL. That should stop the crash in other cases, but something is wrong if welt->lookup_kartenboden() is returning NULL on any valid land tile (or if a non-water industry is giving it a tile other than a valid land tile here).
Title: Re: [BUG] Possibility of factory smoke crash
Post by: RESTRICTED ACCOUNT on August 20, 2020, 06:41:22 PM
Quote from: jamespetts on August 20, 2020, 06:38:36 PMCan you check what sort of industry it was with a NULL ground?
It was a coal mine and a coal power plant around 1910. I was connecting the two and playing for a while.
Title: Re: [BUG] Possibility of factory smoke crash
Post by: TurfIt on August 20, 2020, 07:26:43 PM
Rotated factory near the map edge? Standard used to crash from that - already fixed.
Title: Re: [BUG] Possibility of factory smoke crash
Post by: jamespetts on August 21, 2020, 10:00:32 AM
Quote from: TurfIt on August 20, 2020, 07:26:43 PM
Rotated factory near the map edge? Standard used to crash from that - already fixed.

Interesting, thank you for letting me know. May I ask how one would go about finding the fix in the Standard Github repository that mirrors the SVN?
Title: Re: [BUG] Possibility of factory smoke crash
Post by: RESTRICTED ACCOUNT on August 21, 2020, 10:54:19 AM
Quote from: TurfIt on August 20, 2020, 07:26:43 PMRotated factory
No. (´・ω・`)

Quotenear the map edge?
Yes.


I was wondering if the saved game was lost due to the crash, but fortunately the first data was left.
So I managed to make a saved game that can reliably reproduce this crash.

Load this saved game (https://drive.google.com/file/d/1qVb57cjt9cJCclvZHQhgzXLuyhhA7qRK/view?usp=sharing) and fast forward a bit. Soon your game will be burnt in smoke.
You can check if this issue is fixed.
Title: Re: [BUG] Possibility of factory smoke crash
Post by: jamespetts on August 21, 2020, 11:19:22 AM
Thank you for that - that is helpful. What it appears was happening was that gr was being set from an invalid tile (-1, 185), and so was becoming NULL. This was because nothing in the code constrained the tile to one within the map. I have added code so constraining it, so now it does not crash, and, unlike the simple solution of simply checking whether gr is NULL, also does not prevent the factory smoke from working. The smoke does not move as much as it would in a different position, but this is preferable either to crashing or there being no smoke at all.

I should be grateful if you could re-test with the latest version on the master branch. Thank you.
Title: Re: [BUG] Possibility of factory smoke crash
Post by: RESTRICTED ACCOUNT on August 27, 2020, 12:24:09 PM
I've confirmed that this bug has been fixed.
Thank you for your work. (´・ω・`)b
Title: Re: [BUG] Possibility of factory smoke crash
Post by: jamespetts on August 27, 2020, 12:49:37 PM
Quote from: Ranran on August 27, 2020, 12:24:09 PM
I've confirmed that this bug has been fixed.
Thank you for your work. (´・ω・`)b

Splendid, thank you for confirming.