News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Crash due to "Too many (%i) industry roads!" when closing the game

Started by Ranran, December 27, 2022, 10:54:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran

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.

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran

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

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran

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.

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Mariculous

I have reproduced this in pak256 using the build from latest nightly.

The codelines causing the error:
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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran

#11
I suppose I've found the cause of this frequent and annoying error.
num_industry_roads is not initialized when the game starts, so if the value is higher than 16 due to undefined behavior, the game could not be closed or saved.

Also I found a bug where the permission button is not displayed when a player is born, so I submit a patch to fix those.
Please check Pull request #654.

jamespetts

Quote from: Ranran on May 24, 2024, 08:46:33 AMI suppose I've found the cause of this frequent and annoying error.
num_industry_roads is not initialized when the game starts, so if the value is higher than 16 due to undefined behavior, the game could not be closed or saved.

Also I found a bug where the permission button is not displayed when a player is born, so I submit a patch to fix those.
Please check Pull request #654.
Thank you very much for this - fix now incorporated.

I wonder whether anyone else can confirm whether this fixes the crash?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.