CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.61k stars 4.17k forks source link

Vehicle placement segfault #29456

Closed ymber closed 5 years ago

ymber commented 5 years ago

Describe the bug
The game segfaulted when trying to place a vehicle.

src/mapgen.cpp:6894 [vehicle* map::add_vehicle(const vproto_id&, const tripoint&, int, int, int, bool)] Out of bounds add_vehicle t=none d=0 p=-8,125,0
The program has crashed.
See the log file for a stack trace.
CRASH LOG FILE: ./config/crash.log
VERSION: 0.D-1535-g06002e6
TYPE: Signal
MESSAGE: SIGSEGV: Segmentation fault
STACK TRACE:

    ./cataclysm-tiles(_Z21debug_write_backtraceRSo+0x25) [0x7d25b6]
    ./cataclysm-tiles() [0x7c48cb]
    ./cataclysm-tiles() [0x7c4acc]
    /usr/lib/libc.so.6(+0x37e00) [0x7f71cd702e00]
    /usr/lib/libstdc++.so.6(_ZNSs6assignERKSs+0x1f) [0x7f71cdb0534f]
    ./cataclysm-tiles(_ZN7vehicle14split_vehiclesERKSt6vectorIS0_IiSaIiEESaIS2_EERKS0_IPS_SaIS7_EERKS0_IS0_I5pointSaISC_EESaISE_EE+0x2bd) [0xd26e5b]
    ./cataclysm-tiles(_ZN7vehicle14split_vehiclesERKSt6vectorIS0_IiSaIiEESaIS2_EE+0xcb) [0xd27517]
    ./cataclysm-tiles(_ZN7vehicle23find_and_split_vehiclesEi+0x389) [0xd278f7]
    ./cataclysm-tiles(_ZN7vehicle9break_offEii+0x2f5) [0xd27f05]
    ./cataclysm-tiles(_ZN7vehicle13damage_directEii11damage_type+0x118) [0xd2813e]
    ./cataclysm-tiles(_ZN7vehicle6damageEii11damage_typeb+0x324) [0xd28728]
    ./cataclysm-tiles(_ZN3map12bash_vehicleERK8tripointR11bash_params+0x4b) [0x9cc4f9]
    ./cataclysm-tiles(_ZN3map4bashERK8tripointibbbPK7vehicle+0xbf) [0x9dbaf5]
    ./cataclysm-tiles(_ZN7monster7bash_atERK8tripoint+0xb8) [0xace29e]
    ./cataclysm-tiles(_ZN7monster4moveEv+0xf66) [0xad18c8]
    ./cataclysm-tiles(_ZN4game7monmoveEv+0x791) [0x871b95]
    ./cataclysm-tiles(_ZN4game7do_turnEv+0x70f) [0x874257]
    ./cataclysm-tiles(main+0x1483) [0x69fc79]
    /usr/lib/libc.so.6(__libc_start_main+0xf3) [0x7f71cd6ef223]
    ./cataclysm-tiles(_start+0x29) [0x6c90d9]

    Attempting to repeat stack trace using debug symbols...
    debug_write_backtrace(std::ostream&)
    ??:?
    log_crash
    crash.cpp:?
    signal_handler
    crash.cpp:?
    ??
    ??:0
    std::string::assign(std::string const&)
    .../src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:695
    vehicle::split_vehicles(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, std::vector<vehicle*, std::allocator<vehicle*> > const&, std::vector<std::vector<point, std::allocator<point> >, std::allocator<std::vector<point, std::allocator<point> > > > const&)
    ??:?
    vehicle::split_vehicles(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&)
    ??:?
    vehicle::find_and_split_vehicles(int)
    ??:?
    vehicle::break_off(int, int)
    ??:?
    vehicle::damage_direct(int, int, damage_type)
    ??:?
    vehicle::damage(int, int, damage_type, bool)
    ??:?
    map::bash_vehicle(tripoint const&, bash_params&)
    ??:?
    map::bash(tripoint const&, int, bool, bool, bool, vehicle const*)
    ??:?
    monster::bash_at(tripoint const&)
    ??:?
    monster::move()
    ??:?
    game::monmove()
    ??:?
    game::do_turn()
    ??:?
    main
    ??:?
    __libc_start_main
    ??:?
    _start
    ??:?

To Reproduce
Cannot reliably reproduce. The world had been played in and other vehicles placed in mapgen without issue.

Versions and configuration(please complete the following information):

ymber commented 5 years ago

Saint Lucas.zip Walking a few steps east into the pavilion tile in that save intermittently reproduces the crash.

neitsa commented 5 years ago

Duplicate of #28156

vid512 commented 5 years ago

Same crash has happened to me now with 0.D stable, while butchering a corpse. Screenshot 2019-08-04 11 08 02

The config\crash.log file was empty. I haven't touched the save file since, so not sure if the crash is reproducible. Let me know if more info is needed.