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

Fake targeting NPC causes segfaults in unowned vehicles #34209

Closed
DeeUnderscore opened this issue Sep 24, 2019 · 0 comments · Fixed by #34217
Closed

Fake targeting NPC causes segfaults in unowned vehicles #34209

DeeUnderscore opened this issue Sep 24, 2019 · 0 comments · Fixed by #34217
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes. (S1 - Need confirmation) Report waiting on confirmation of reproducibility Vehicles Vehicles, parts, mechanics & interactions

Comments

@DeeUnderscore
Copy link
Contributor

Describe the bug

Loading a save, or a part of a map with an unowned vehicle (ie, saved before vehicle ownership went in), where an automatic turret is present on the vehicle, will cause a segfault as the game tries to assign the fake turret NPC to a faction.

I first encountered this as a segfault when playing an old save and entering a part of the map that contained the offending vehicle, but it can happen on first turn after game load as well.

Steps To Reproduce

  1. Start a world with an old version of the game (I used 0.D-5135-g41916c4fd6)
  2. Place a vehicle with an active automatic turret in the world.
  3. Save
  4. Load the world with a current version, and move into the area with the vehicle (if needed)
  5. Experience a segmentation fault

Expected behavior

Either automatically assign the vehicle to Your Followers for minimum amount of nasty surprises, or disable the turret until the player claims the vehicle.

Versions and configuration

  • OS: Ubuntu 19.04
  • Game Version: 0.D-7842-gcfc7f8a86d
  • Graphics version: tiles
  • Mods loaded: (defaults)

Additional context

Stack trace

* thread #1, name = 'cataclysm-tiles', stop reason = signal SIGSEGV: invalid address (fault address: 0x38)
  * frame #0: 0x00007f079196da30 libstdc++.so.6`std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const
    frame #1: 0x0000000000da2c9e cataclysm-tiles`__gnu_cxx::__enable_if<__is_char<char>::__value, bool>::__type std::operator==<char>(__lhs="your_followers", __rhs=0x0000000000000030) at basic_string.h:6019:37
    frame #2: 0x0000000001165956 cataclysm-tiles`faction_manager::get(this=0x00000000023b62a0, id=0x0000000000000030, complain=true) at faction.cpp:390:24
    frame #3: 0x00000000017b72aa cataclysm-tiles`npc::set_fac(this=0x00007fffae878e70, id=0x0000000000000030) at npc.cpp:445:38
    frame #4: 0x0000000001b43209 cataclysm-tiles`vehicle::get_targeting_npc(this=0x00000000023c21d0, pt=0x0000000002ec0590) at turret.cpp:514:9
    frame #5: 0x0000000001b432c4 cataclysm-tiles`vehicle::automatic_fire_turret(this=0x00000000023c21d0, pt=0x0000000002ec0590) at turret.cpp:532:15
    frame #6: 0x0000000001ba707d cataclysm-tiles`vehicle::gain_moves(this=0x00000000023c21d0) at vehicle.cpp:5073:13
    frame #7: 0x00000000014d9463 cataclysm-tiles`map::vehmove(this=<unavailable>) at map.cpp:364:18
    frame #8: 0x00000000011bfc29 cataclysm-tiles`game::do_turn(this=<unavailable>) at game.cpp:1514:7
    frame #9: 0x00000000014c9ec2 cataclysm-tiles`main(argc=<unavailable>, argv=<unavailable>) at main.cpp:688:20
    frame #10: 0x00007f0791500b6b libc.so.6`__libc_start_main(main=(cataclysm-tiles`main at main.cpp:134), argc=1, argv=0x00007fffae881ba8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffae881b98) at libc-start.c:308:16
    frame #11: 0x0000000000d9a02a cataclysm-tiles`_start + 42

Save

TESTWORLD3.tar.gz: This was saved with 0.D-5135-g41916c4fd6. When loaded with 0.D-7842-gcfc7f8a86d it crashes on first turn (press .).

@Night-Pryanik Night-Pryanik added (S1 - Need confirmation) Report waiting on confirmation of reproducibility <Crash / Freeze> Fatal bug that results in hangs or crashes. Vehicles Vehicles, parts, mechanics & interactions labels Sep 24, 2019
@ghost ghost self-assigned this Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes. (S1 - Need confirmation) Report waiting on confirmation of reproducibility Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants