The International Simutrans Forum

 

Author Topic: Fatal crashes when trying to view networks on the minimap  (Read 184 times)

0 Members and 1 Guest are viewing this topic.

Offline freddyhayward

  • *
  • Posts: 4
Fatal crashes when trying to view networks on the minimap
« on: April 22, 2019, 12:44:42 PM »
I have networks/passengers/transfers selected on the minimap by default and have been experiencing regular crashes. I experimented with different combinations and sequences and tabled the results. The cause of the crash seems to be an attempt to display nodes of a nonexistent network. I have video recordings to be uploaded if necessary.
Action Result
new game -> open map no crash
new game -> place stop no crash
new game -> place stops no crash
new game -> open map -> place stop crash
new game -> place stop -> open map crash
new game -> place stops -> open map crash
new game -> place stops -> create mail line -> open map crash
new game -> place stops -> create passenger line -> open map no crash
existing game -> open map -> uncheck transfers -> uncheck networks no crash
existing game -> open map -> uncheck transfers -> select mail no crash
existing game -> open map -> select mail crash
existing game -> open map -> uncheck networks crash

Online ACarlotti

  • *
  • Posts: 356
Re: Fatal crashes when trying to view networks on the minimap
« Reply #1 on: April 22, 2019, 05:45:10 PM »
It's an off-by-one error in the upper bound for a loop in gui/karte.cc, which would manifest if there were halts that weren't transfers. Although I'm slightly unsure why you're penultimate case would crash. Can you test this again (and also recheck the other cases) once James has incorporated my fix?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Fatal crashes when trying to view networks on the minimap
« Reply #2 on: April 22, 2019, 08:06:29 PM »
Thank you both - I have now incorporated A. Carlotti's fix. I cannot reproduce the last crash with this fix; I should be grateful if you could re-test with to-morrow's nightly build.

Offline freddyhayward

  • *
  • Posts: 4
Re: Fatal crashes when trying to view networks on the minimap
« Reply #3 on: April 22, 2019, 10:33:48 PM »
Quote
I'm slightly unsure why you're penultimate case would crash.
This crash happens when there is a passenger network but no mail network. If both are present then switching doesn't cause a crash.

Online ACarlotti

  • *
  • Posts: 356
Re: Fatal crashes when trying to view networks on the minimap
« Reply #4 on: April 22, 2019, 11:31:32 PM »
This crash happens when there is a passenger network but no mail network. If both are present then switching doesn't cause a crash.

If you can still produce that crash using the upcoming nightly build, then can you upload a save which demonstrates it?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Fatal crashes when trying to view networks on the minimap
« Reply #5 on: April 22, 2019, 11:34:51 PM »
For reference, when I fix a problem in the code, it will be incorporated into the next nightly build. This is usually compiled at around 0500-0600h GMT every day, so you will need to wait until the build from after circa 0600h on the 23rd of April 2019 to check whether this is solved - unless you are compiling yourself, of course.

My apologies if you already knew this; it is not obvious whether this is obvious.

Offline freddyhayward

  • *
  • Posts: 4
Re: Fatal crashes when trying to view networks on the minimap
« Reply #6 on: April 23, 2019, 07:52:42 AM »
The problem seems to have been fixed in the latest build.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Fatal crashes when trying to view networks on the minimap
« Reply #7 on: April 23, 2019, 10:00:51 AM »
Splendid, thank you for confirming.