Author Topic: Simutrans nightly is unstable, how to help find the cause?  (Read 384 times)

0 Members and 1 Guest are viewing this topic.

Offline Antarctica

Simutrans nightly is unstable, how to help find the cause?
« on: June 15, 2017, 03:24:45 PM »
I have found that the June 6 nightly is quite unstable. I have played it a bit, trying out longer convois (less than 128 because longer was still buggy) and it seems to crash randomly during normal simulation (4 times in about 4 hours playtime). I will try again in the June 12 nightly, but how can I help you to determine the cause of the issue? Can I get you a stacktrace from somewhere, enable a debug log or something like that?

Offline DrSuperGood

Re: Simutrans nightly is unstable, how to help find the cause?
« Reply #1 on: June 16, 2017, 12:16:34 AM »
If one lets the game run fast forward on a particular save does it crash? In which case post the save/pakset.

It is possible this is already fixed, some of the commits seem that changes have been made to make long convoys less buggy.

Offline Antarctica

Re: Simutrans nightly is unstable, how to help find the cause?
« Reply #2 on: June 16, 2017, 02:11:04 PM »
I don't have a savegame that reproduces this reliably, but yes, I think it was always during fast-forward. The June 12th nightly has also crashed twice in six hours play time.

Offline DrSuperGood

Re: Simutrans nightly is unstable, how to help find the cause?
« Reply #3 on: June 17, 2017, 05:31:19 AM »
Can you reproduce this crash on another computer? If so then something is wrong in the code. This is to rule out the crash being caused by the computer rather than the code.

Try and find/make a save file that if run fast forward crashes eventually. Does not matter if it takes an hour of fast forward, it just needs a reasonable chance to crash so that the error can be recreated in a debug build so the problematic code can be located.

Does the crash produce any line numbers? Or at least an instruction pointer (instruction at 0xXXXXXXXX blah). If it does then this address might be used with the build symbol table to help locate what code is producing the crash, even if it was optimized.

Another approach would be to track down which exact revision started to crash. However doing so might be harder than recreating the crash reliably in the first place. It might even be a very old crash that you are just running into for one reason or another (like the cyclic intersection dependency crash that was eventually fixed).

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4635
  • Total likes: 168
  • Helpful: 108
  • Languages: EN, NO
Re: Simutrans nightly is unstable, how to help find the cause?
« Reply #4 on: June 17, 2017, 07:25:30 AM »
If it does then this address might be used with the build symbol table to help locate what code is producing the crash, even if it was optimized.

There is no symbol table in the nightly builds.

Offline DrSuperGood

Re: Simutrans nightly is unstable, how to help find the cause?
« Reply #5 on: June 17, 2017, 04:24:36 PM »
Quote
There is no symbol table in the nightly builds.
Can it not be configured to produce one? I know MSVC can build a symbol table for optimized code and even debug with it, even if it is often not that useful due to the optimizations.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4635
  • Total likes: 168
  • Helpful: 108
  • Languages: EN, NO
Re: Simutrans nightly is unstable, how to help find the cause?
« Reply #6 on: June 17, 2017, 05:46:58 PM »
GCC puts the symbol table in the generated executable. But this can be removed, for example to save space, which seems to be done for the nightly builds. I've never been able to read out any symbol tables, at least, and I have lamented the lack of symbols on at least one occasion earlier.

(GCC can generate a separate memory map file, but this is a text file which is rather huge for statically linked Simutrans. I've never heard of any tools that can assist in reading it.)