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

Crash when there are no placable terrains in a city #62011

Open
NetSysFire opened this issue Oct 29, 2022 · 2 comments
Open

Crash when there are no placable terrains in a city #62011

NetSysFire opened this issue Oct 29, 2022 · 2 comments
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Crash / Freeze> Fatal bug that results in hangs or crashes. Map / Mapgen Overmap, Mapgen, Map extras, Map display (P4 - Low) Low priority issues: things which are e.g exotic, minor and/or hard to encounter

Comments

@NetSysFire
Copy link
Member

Describe the bug

I am fiddling around with modding and overwrote the default region.

    "city": {
      "shop_radius": 1,
      "shop_sigma": 1,
      "park_radius": 1,
      "park_sigma": 1,
      "houses": { "does_not_exist": 1 },
      "parks": { "field": 1 },
      "shops": { "field": 1 }
    }

This will cause a crash after several debug errors since the game has nothing to place.

Steps to reproduce

  1. Alter your default region settings in a mod, making a subset (I used houses here but I am pretty sure this also applies to parks and shops) empty/not being able to generate due to an error
  2. Try to create a character, you will get:
 DEBUG    : Tried to add city building does_not_exist, but it is neither a special nor a terrain type

 FUNCTION : void building_bin::finalize()
 FILE     : src/regional_settings.cpp
 LINE     : 1168
 VERSION  : 0.F-11996-gd0fa99b1bbb
  1. Skip it and wait until the next error:
 DEBUG    : Mapgen does_not_exist is not used by anything!

 FUNCTION : void mapgen_factory::check_consistency()
 FILE     : src/mapgen.cpp
 LINE     : 446
 VERSION  : 0.F-11996-gd0fa99b1bbb
  1. The game crashes after you finish character creation and enter the world (during the "Please wait while we build your world" step).
STACK TRACE:

    cataclysm-tiles(debug_write_backtrace(std::ostream&)+0x42) [0x55b1b1d0bd29]
    cataclysm-tiles(+0xccfb4f) [0x55b1b1ce9b4f]
    cataclysm-tiles(+0xccfde0) [0x55b1b1ce9de0]
    /usr/lib/libc.so.6(+0x38a00) [0x7f3350062a00]
    cataclysm-tiles(building_bin::pick() const+0xe1) [0x55b1b2650bbf]
    cataclysm-tiles(overmap::pick_random_building_to_place(int) const+0xa9) [0x55b1b253b97d]
    cataclysm-tiles(overmap::place_building(coords::coord_point<tripoint, (coords::origin)4, (coords::scale)2> const&, om_direction::type, city const&)+0xb1) [0x55b1b254623d]
    cataclysm-tiles(overmap::build_city_street(overmap_connection const&, coords::coord_point<point, (coords::origin)4, (coords::scale)2> const&, int, om_direction::type, city const&, int)+0x30a) [0x55b1b25465ce]
    cataclysm-tiles(overmap::place_cities()+0x519) [0x55b1b2546bff]
    cataclysm-tiles(overmap::generate(overmap const*, overmap const*, overmap const*, overmap const*, overmap_special_batch&)+0x596) [0x55b1b254a6ac]
    cataclysm-tiles(overmap::open(overmap_special_batch&)+0x20e) [0x55b1b254ab4e]
    cataclysm-tiles(overmap::populate(overmap_special_batch&)+0x24) [0x55b1b254ac0a]
    cataclysm-tiles(overmap::populate()+0xb4) [0x55b1b254ad64]
    cataclysm-tiles(overmapbuffer::get(coords::coord_point<point, (coords::origin)1, (coords::scale)4> const&)+0xa1) [0x55b1b259cfd7]
    cataclysm-tiles(start_location::find_player_initial_location(coords::coord_point<point, (coords::origin)1, (coords::scale)4> const&) const+0x82) [0x55b1b2751e7c]
    cataclysm-tiles(game::start_game()+0x55e) [0x55b1b1e96610]
    cataclysm-tiles(main_menu::new_character_tab()+0xafe) [0x55b1b2199490]
    cataclysm-tiles(main_menu::opening_screen()+0x12c8) [0x55b1b219b2fa]
    cataclysm-tiles(main+0x1dfc) [0x55b1b17ab6d5]
    /usr/lib/libc.so.6(+0x23290) [0x7f335004d290]

    Attempting to repeat stack trace using debug symbols…
    debug_write_backtrace(std::ostream&)
    ??:?
    init_crash_handlers()
    ??:?
    init_crash_handlers()
    ??:?
    ??
    ??:0
    building_bin::pick() const
    ??:?
    overmap::pick_random_building_to_place(int) const
    ??:?
    overmap::place_building(coords::coord_point<tripoint, (coords::origin)4, (coords::scale)2> const&, om_direction::type, city const&)
    ??:?
    overmap::build_city_street(overmap_connection const&, coords::coord_point<point, (coords::origin)4, (coords::scale)2> const&, int, om_direction::type, city const&, int)
    ??:?
    overmap::place_cities()
    ??:?
    overmap::generate(overmap const*, overmap const*, overmap const*, overmap const*, overmap_special_batch&)
    ??:?
    overmap::open(overmap_special_batch&)
    ??:?
    overmap::populate(overmap_special_batch&)
    ??:?
    overmap::populate()
    ??:?
    overmapbuffer::get(coords::coord_point<point, (coords::origin)1, (coords::scale)4> const&)
    ??:?
    start_location::find_player_initial_location(coords::coord_point<point, (coords::origin)1, (coords::scale)4> const&) const
    ??:?
    game::start_game()
    ??:?
    main_menu::new_character_tab()
    ??:?
    main_menu::opening_screen()
    ??:?
    main
    ??:?
    ??
    ??:0

Expected behavior

No crash but a fatal error which drops you back to the main menu. This is a fairly obscure crash which can only be reproduced under very specific conditions with a special mod. Still shouldn't happen though but justifies a low priority.

Also I know my version is fairly old but this should not matter too much. Too lazy to hit compile since the builds on here simply wont cut it for me.

Screenshots

No response

Versions and configuration

  • OS: Linux
    • OS Version: LSB Version: n/a; Distributor ID: Arch; Description: Arch Linux; Release: rolling; Codename: n/a;
  • Game Version: 0.F-11996-gd0fa99b1bbb [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Crash the Game [demo]
    ]

Additional context

No response

@NetSysFire NetSysFire added <Crash / Freeze> Fatal bug that results in hangs or crashes. [C++] Changes (can be) made in C++. Previously named `Code` (P4 - Low) Low priority issues: things which are e.g exotic, minor and/or hard to encounter Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Oct 29, 2022
@ZhilkinSerg
Copy link
Contributor

Make does_not_exist overmap terrain or overmap terrain special and game won't crash.

@NetSysFire
Copy link
Member Author

Yeah I know I have forgotten this but this is still something which should not happen. The game should not crash and this needs to be handled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Crash / Freeze> Fatal bug that results in hangs or crashes. Map / Mapgen Overmap, Mapgen, Map extras, Map display (P4 - Low) Low priority issues: things which are e.g exotic, minor and/or hard to encounter
Projects
None yet
Development

No branches or pull requests

2 participants