The International Simutrans Forum

 

Author Topic: [BUG] Possibility of factory smoke crash  (Read 395 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1160
  • Languages: ja
[BUG] Possibility of factory smoke crash
« 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. (´・ω・`)









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.
« Last Edit: August 27, 2020, 12:24:23 PM by Ranran »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20207
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG] Possibility of factory smoke crash
« Reply #1 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).

Offline Ranran

  • Devotee
  • *
  • Posts: 1160
  • Languages: ja
Re: [BUG] Possibility of factory smoke crash
« Reply #2 on: August 20, 2020, 06:41:22 PM »
Can 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.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1389
Re: [BUG] Possibility of factory smoke crash
« Reply #3 on: August 20, 2020, 07:26:43 PM »
Rotated factory near the map edge? Standard used to crash from that - already fixed.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20207
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG] Possibility of factory smoke crash
« Reply #4 on: August 21, 2020, 10:00:32 AM »
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?

Offline Ranran

  • Devotee
  • *
  • Posts: 1160
  • Languages: ja
Re: [BUG] Possibility of factory smoke crash
« Reply #5 on: August 21, 2020, 10:54:19 AM »
Rotated factory
No. (´・ω・`)

Quote
near 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 and fast forward a bit. Soon your game will be burnt in smoke.
You can check if this issue is fixed.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20207
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG] Possibility of factory smoke crash
« Reply #6 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.

Offline Ranran

  • Devotee
  • *
  • Posts: 1160
  • Languages: ja
Re: [BUG] Possibility of factory smoke crash
« Reply #7 on: August 27, 2020, 12:24:09 PM »
I've confirmed that this bug has been fixed.
Thank you for your work. (´・ω・`)b

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20207
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG] Possibility of factory smoke crash
« Reply #8 on: August 27, 2020, 12:49:37 PM »
I've confirmed that this bug has been fixed.
Thank you for your work. (´・ω・`)b

Splendid, thank you for confirming.