The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Simutrans-Extended bug reports => Topic started by: Ranran(retired) on December 27, 2022, 10:54:26 AM

Title: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: Ranran(retired) on December 27, 2022, 10:54:26 AM
This seems to happen a lot when using paksets other than pak britain.
This error message appears when the game is about to close and the game does not close properly.
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: jamespetts on December 27, 2022, 11:25:00 AM
Quote from: (N)Ranran (Hibernating) on December 27, 2022, 10:54:26 AMThis seems to happen a lot when using paksets other than pak britain.
This error message appears when the game is about to close and the game does not close properly.
Thank you for the report. Can you specify a reliable reproduction case for this?
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: Ranran(retired) on December 27, 2022, 11:30:48 AM
Quote from: jamespetts on December 27, 2022, 11:25:00 AMThank you for the report. Can you specify a reliable reproduction case for this?
If this crash occurs, the save cannot be performed and therefore no save can be provided. The game crashes when trying to save.
For example, if you don't load a save in pak192.comic and try to close the automatically generated small map, this error will occur quite often. Confirmed crash 3 times in 3 trials.
The game crashes when trying to save too.
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: jamespetts on December 27, 2022, 01:09:01 PM
Quote from: (N)Ranran (Hibernating) on December 27, 2022, 11:30:48 AMIf this crash occurs, the save cannot be performed and therefore no save can be provided. The game crashes when trying to save.
For example, if you don't load a save in pak192.comic and try to close the automatically generated small map, this error will occur quite often. Confirmed crash 3 times in 3 trials.
The game crashes when trying to save too.
Thank you - I will have to look into this when I get back from my Christmas holiday.
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: jamespetts on January 09, 2023, 04:16:12 PM
Looking into this, the version of Pak192.Comic that I have does not load. Can I check what version of Pak192.Comic that you are using?
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: Ranran(retired) on January 09, 2023, 08:45:19 PM
Quote from: jamespetts on January 09, 2023, 04:16:12 PMLooking into this, the version of Pak192.Comic that I have does not load. Can I check what version of Pak192.Comic that you are using?
Yes, due to recent updates the available pak192.comic for extended is no longer available for download.
They are missing many of the required paks and cannot boot.
I haven't checked the details, but it should be noted that the new standard's format of dat is not available in extended.


Anyways, download it here
https://drive.google.com/file/d/1q16Yie3kkHPfWDEo4AFl1sltQBaR0CfL/view?usp=sharing
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: jamespetts on January 09, 2023, 09:17:59 PM
Quote from: (N)Ranran (Hibernating) on January 09, 2023, 08:45:19 PMYes, due to recent updates the available pak192.comic for extended is no longer available for download.
They are missing many of the required paks and cannot boot.
I haven't checked the details, but it should be noted that the new standard's format of dat is not available in extended.


Anyways, download it here
https://drive.google.com/file/d/1q16Yie3kkHPfWDEo4AFl1sltQBaR0CfL/view?usp=sharing

Thank you for that. The pakset works, but I cannot reproduce this crash. I have tried opening and closing the default map 5 times and saving it twice, and it did not occur once. I should note that I was using the Visual Studio debug build in order to catch any crashes.
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: Ranran(retired) on January 10, 2023, 11:55:58 AM
Quote from: jamespetts on January 09, 2023, 09:17:59 PMThank you for that. The pakset works, but I cannot reproduce this crash.
have you tried it with pak.sweden? Still it is highly reproducible.
You need to discard the autosaved map by exiting the game with the new map generation window open or by deleting autosave. Then boot the game again. And when I try to quit the game it crashes.
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: jamespetts on January 11, 2023, 01:20:42 AM
Quote from: (N)Ranran (Hibernating) on January 10, 2023, 11:55:58 AMhave you tried it with pak.sweden? Still it is highly reproducible.
You need to discard the autosaved map by exiting the game with the new map generation window open or by deleting autosave. Then boot the game again. And when I try to quit the game it crashes.
Thank you for that. Unfortunately, I am still unable to reproduce this with a debug build. Were you using a debug or release build when you were able to reproduce this?
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: Mariculous on January 19, 2023, 06:05:22 PM
I have reproduced this in pak256 using the build from latest nightly.

The codelines causing the error (https://github.com/jamespetts/simutrans-extended/blob/6a32723219997ec6f8649cc744a6dccd6daa7ea8/dataobj/settings.cc#L587-L589):
if (num_industry_roads >= 16) {
    dbg->fatal("settings_t::rdwr()", "Too many (%i) industry roads!", num_industry_roads);
}

I am not yet sure why there is such a limitation to 16 city road types, but more importantly, I don't think pak256 has 71 city road types, so there is something wrong with this num_industry_roads counter.

Edit: Could not reproduce it with a self-built clang release build nor with a self-built MSVC release build.
Edit 2: Cannot reproduce this anymore at all. For some reasons, latest nightly with pak256 works fine now...

Yet another edit:
Okay, I have now reproduced this reliably, at least on my system. Sadly, I cannot debug this, because this occurs reliably with the description below, but I couldn't reproduce it with any self-compiled release build: MSVC 11 (Windows), clang 11 (Linux), gcc 7 (Linux) and I don't know the setup of the BB build server.
- Launch a Windows
- Get latest extended nightly (from BB)
- Get pak256 release 2.4.0.1
- Make sure that there is no autosave-pak256-release-2.4.0.1.sve in your users simutrans directory (not the one where you have extracted the game, but the one where saves and screenshots are stored)
- Launch the game
- Close the game
- BAM

Feels like undefined behavior is doing its job somewhere.
Title: Re: Crash due to "Too many (%i) industry roads!" when closing the game
Post by: jamespetts on January 21, 2023, 07:33:02 PM
Thank you for your work on this - this seems as though it is very difficult indeed to debug - and appears to arise in code unchanged from Standard.