Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random map generation failure crashes the game (dedicated server). #7646

Open
James103 opened this issue Jul 10, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@James103
Copy link

commented Jul 10, 2019

Version of OpenTTD

1.9.2 and master-20190707

Expected result

Random map generation failure should cause the next attempt to use a random seed that should hopefully succeed (regardless of if a set seed was input into the "newmap" / "newgame" command)

Actual result

Random map generation failure crashes the game with NOT_REACHED triggered at line 140 of d:\a\1\s\src\thread\thread_win32.cpp while in a dedicated server. Crash info has been attached.

Steps to reproduce

Set the map generation settings as follows (from my openttd.cfg):

town_name = 21
landscape = temperate
snow_line_height = 15
starting_year = 3000
land_generator = 1
oil_refinery_limit = 48
tgen_smoothness = 3
variety = 0
generation_seed = 32
tree_placer = 0
heightmap_rotation = 0
se_flat_world_height = 1
map_x = 6
map_y = 6
water_borders = 15
custom_town_number = 5000
custom_sea_level = 90
min_river_length = 16
river_route_random = 5
amount_of_rivers = 0

Then, run openttd -D ::1 (dedicated server) and type newmap 32 or newgame 32 into the console. If that doesn't work, try some other seeds/settings. If the map generation fails, then the game crashes.

@LordAro

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

Interesting that it also crashes in master, given the threading code has been rewritten since 1.9.x. Presumably the error message is different, as thread_win32.cpp doesn't exist anymore :)

@James103

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

@LordAro
I haven't tested master (20190707) yet when you made your comment. Actually, OpenTTD master (20190707-master- 1e72393) does crash (Assertion failed at line 61 of d:\a\1\s\src\newgrf_storage.cpp: ignore_prev_mode || !gameloop) when random map generation fails as a dedicated server. Crash logs and console log has been attached.

@James103

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

I can't give you the full stacktrace, but I can tell that the assert was triggered because

/* static */ void BasePersistentStorageArray::SwitchMode(PersistentStorageMode mode, bool ignore_prev_mode)
was called twice in a row, both times trying to enter the game loop (PSM_ENTER_GAMELOOP).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.