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

Crash when (auto-)saving the game #62954

Closed moxian closed 1 year ago

moxian commented 1 year ago

Describe the bug

Was walking around; game crashed. Judging by the backtrace, did so when attempting to save the game.

The savefile appears to be corrupted - there are two identical characters, and trying to load throws a bunch of (skippable) errors.

Given that the backtrace mentions item_contents, i should probably mention that not long before the crash i: 1) acquired military rucksack, washed it 2) set its main pocket priority to 1 (from the default 0) 3) worn it 4) Unloaded the backpack i had on me at the time (also had its main pocket priority set to 1 some time prior). Presumably, the items got dumped into the military rucksack, but i didn't check 5) Took off the backpack 6) walked ~10 tiles towards the basement stairs 7) got the crash before i reached the destination

The save appears to have happened between steps (3) and (6). Maybe during the Unloading? But then why did it not crash until after?

Other than the loading errors, the character appears to be mostly the way i remember him. I don't notice any items missing either.

Steps to reproduce

unknown

Expected behavior

No crash

Screenshots

No response

Versions and configuration

Additional context

crash.log ``` The program has crashed. See the log file for a stack trace. CRASH LOG FILE: ./config/crash.log VERSION: ba42c0a TYPE: Signal MESSAGE: SIGSEGV: Segmentation fault STACK TRACE: #0 (dbghelp: @0x7ff611014710[cataclysm-tiles.exe+0x234710]), (libbacktrace: debug_write_backtrace(std::ostream&)+0x9e@0x140234710), 0x140234710 src/debug.cpp:1119 debug_write_backtrace(std::ostream&) #1 (dbghelp: @0x7ff610ffd101[cataclysm-tiles.exe+0x21d101]), (libbacktrace: log_crash+0x1d2@0x14021d101), 0x14021d101 /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/sstream:917 std::__cxx11::basic_ostringstream, std::allocator >::str() const 0x14021d101 src/crash.cpp:85 log_crash #2 (dbghelp: @0x7ff610ffd32f[cataclysm-tiles.exe+0x21d32f]), (libbacktrace: signal_handler+0x52@0x14021d32f), 0x14021d32f src/crash.cpp:137 signal_handler #3 (dbghelp: @0x7ff611942a92[cataclysm-tiles.exe+0xb62a92]), (libbacktrace: gnu_exception_handler+0x182@0x140b62a92), 0x140b62a92 /opt/mxe/tmp-gcc-x86_64-w64-mingw32.static.gcc11/gcc-11.2.0.build_/mingw-w64-v9.0.0/mingw-w64-crt/crt/crt_handler.c:224 _gnu_exception_handler #4 (dbghelp: _C_specific_handler+0x98@0x7ff8ce297ff8[msvcrt.dll+0x27ff8]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), #5 (dbghelp: _chkstk+0x11f@0x7ff8ce85241f[ntdll.dll+0xa241f]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), #6 (dbghelp: RtlRaiseException+0x434@0x7ff8ce8014a4[ntdll.dll+0x514a4]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), #7 (dbghelp: KiUserExceptionDispatcher+0x2e@0x7ff8ce850f4e[ntdll.dll+0xa0f4e]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), #8 (dbghelp: @0x7ff61124b420[cataclysm-tiles.exe+0x46b420]), (libbacktrace: item_contents::all_items_top[abi:cxx11](std::function const&) const+0x2a@0x14046b420), 0x14046b420 /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/stl_list.h:955 std::__cxx11::list >::begin() const 0x14046b420 src/item_contents.cpp:1473 item_contents::all_items_top[abi:cxx11](std::function const&) const #9 (dbghelp: @0x7ff61124b52e[cataclysm-tiles.exe+0x46b52e]), (libbacktrace: item_contents::all_items_top[abi:cxx11]() const+0x30@0x14046b52e), 0x14046b52e /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/std_function.h:328 ~function 0x14046b52e /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/std_function.h:328 std::function::~function() 0x14046b52e src/item_contents.cpp:1500 item_contents::all_items_top[abi:cxx11]() const #10 (dbghelp: @0x7ff6111f47ba[cataclysm-tiles.exe+0x4147ba]), (libbacktrace: item::all_items_top[abi:cxx11]() const+0x12@0x1404147ba), 0x1404147ba src/item.cpp:14247 item::all_items_top[abi:cxx11]() const #11 (dbghelp: @0x7ff611f47470[cataclysm-tiles.exe+0x1167470]), (libbacktrace: item_location::impl::item_in_container::calc_index() const+0x30@0x141167470), 0x141167470 /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/stl_list.h:946 std::__cxx11::list >::begin() 0x141167470 src/item_location.cpp:568 item_location::impl::item_in_container::calc_index() const #12 (dbghelp: @0x7ff611f47b77[cataclysm-tiles.exe+0x1167b77]), (libbacktrace: item_location::impl::item_in_container::serialize(JsonOut&) const+0x27@0x141167b77), 0x141167b77 src/item_location.cpp:589 item_location::impl::item_in_container::serialize(JsonOut&) const #13 (dbghelp: @0x7ff6116e12f0[cataclysm-tiles.exe+0x9012f0]), (libbacktrace: player_activity::serialize(JsonOut&) const+0x28e@0x1409012f0), 0x1409012f0 src/json.h:778 decltype ((({parm#1}.serialize)(*this)),((void)())) JsonOut::write(item_location const&) 0x1409012f0 src/json.h:848 void JsonOut::write_as_array > >(std::vector > const&) 0x1409012f0 src/json.h:859 decltype ((({parm#1}.front)()),((void)(0))) JsonOut::write >, (void*)0>(std::vector > const&) 0x1409012f0 src/json.h:927 void JsonOut::member > >(std::__cxx11::basic_string, std::allocator > const&, std::vector > const&) 0x1409012f0 src/savegame_json.cpp:341 player_activity::serialize(JsonOut&) const #14 (dbghelp: @0x7ff6116f1b38[cataclysm-tiles.exe+0x911b38]), (libbacktrace: Character::store(JsonOut&) const+0x87e@0x140911b38), 0x140911b38 /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/stl_list.h:305 std::_List_const_iterator::operator++() 0x140911b38 src/json.h:847 void JsonOut::write_as_array > >(std::__cxx11::list > const&) 0x140911b38 src/json.h:859 decltype ((({parm#1}.front)()),((void)(0))) JsonOut::write >, (void*)0>(std::__cxx11::list > const&) 0x140911b38 src/json.h:927 void JsonOut::member > >(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::list > const&) 0x140911b38 src/savegame_json.cpp:1348 Character::store(JsonOut&) const #15 (dbghelp: @0x7ff6116f379a[cataclysm-tiles.exe+0x91379a]), (libbacktrace: avatar::store(JsonOut&) const+0x1c@0x14091379a), 0x14091379a src/savegame_json.cpp:1532 avatar::store(JsonOut&) const #16 (dbghelp: @0x7ff6116f3e17[cataclysm-tiles.exe+0x913e17]), (libbacktrace: avatar::serialize(JsonOut&) const+0x23@0x140913e17), 0x140913e17 src/savegame_json.cpp:1524 avatar::serialize(JsonOut&) const #17 (dbghelp: @0x7ff6116d01c3[cataclysm-tiles.exe+0x8f01c3]), (libbacktrace: game::serialize(std::ostream&)+0x5c3@0x1408f01c3), 0x1408f01c3 /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/basic_string.h:671 std::__cxx11::basic_string, std::allocator >::~basic_string() 0x1408f01c3 src/savegame.cpp:129 game::serialize(std::ostream&) #18 (dbghelp: @0x7ff610f00a9a[cataclysm-tiles.exe+0x120a9a]), (libbacktrace: write_to_file(std::__cxx11::basic_string, std::allocator > const&, std::function const&)+0x49@0x140120a9a), 0x140120a9a src/cata_utility.cpp:270 write_to_file(std::__cxx11::basic_string, std::allocator > const&, std::function const&) #19 (dbghelp: @0x7ff610f00af3[cataclysm-tiles.exe+0x120af3]), (libbacktrace: write_to_file(std::__cxx11::basic_string, std::allocator > const&, std::function const&, char const*)+0x16@0x140120af3), 0x140120af3 src/cata_utility.cpp:278 write_to_file(std::__cxx11::basic_string, std::allocator > const&, std::function const&, char const*) #20 (dbghelp: @0x7ff6110fccec[cataclysm-tiles.exe+0x31ccec]), (libbacktrace: game::save_player_data()+0xce@0x14031ccec), 0x14031ccec /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/basic_string.h:671 std::__cxx11::basic_string, std::allocator >::~basic_string() 0x14031ccec src/game.cpp:2976 game::save_player_data() #21 (dbghelp: @0x7ff61112b2bd[cataclysm-tiles.exe+0x34b2bd]), (libbacktrace: game::save()+0x1c1@0x14034b2bd), 0x14034b2bd src/game.cpp:3062 game::save() #22 (dbghelp: @0x7ff61112b787[cataclysm-tiles.exe+0x34b787]), (libbacktrace: game::quicksave()+0x12d@0x14034b787), 0x14034b787 src/game.cpp:12153 game::quicksave() #23 (dbghelp: @0x7ff6110632d9[cataclysm-tiles.exe+0x2832d9]), (libbacktrace: do_turn()+0x38c@0x1402832d9), 0x1402832d9 src/do_turn.cpp:674 do_turn() #24 (dbghelp: @0x7ff6123deac6[cataclysm-tiles.exe+0x15feac6]), (libbacktrace: main+0x1e80@0x1415feac6), 0x1415feac6 src/main.cpp:817 main #25 (dbghelp: @0x7ff610de13c1[cataclysm-tiles.exe+0x13c1]), (libbacktrace: _tmainCRTStartup+0x231@0x1400013c1), 0x1400013c1 /opt/mxe/tmp-gcc-x86_64-w64-mingw32.static.gcc11/gcc-11.2.0.build_/mingw-w64-v9.0.0/mingw-w64-crt/crt/crtexe.c:323 __tmainCRTStartup #26 (dbghelp: @0x7ff610de14d6[cataclysm-tiles.exe+0x14d6]), (libbacktrace: WinMainCRTStartup+0x16@0x1400014d6), 0x1400014d6 /opt/mxe/tmp-gcc-x86_64-w64-mingw32.static.gcc11/gcc-11.2.0.build_/mingw-w64-v9.0.0/mingw-w64-crt/crt/crtexe.c:178 WinMainCRTStartup #27 (dbghelp: BaseThreadInitThunk+0x14@0x7ff8ce1c7614[KERNEL32.DLL+0x17614]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), #28 (dbghelp: RtlUserThreadStart+0x21@0x7ff8ce8026a1[ntdll.dll+0x526a1]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), ```
debug.log upon loading the savefile ``` ----------------------------------------- 14:46:36.460 : Starting log. 14:46:36.460 INFO : Cataclysm DDA version ba42c0a 14:46:36.460 INFO : [main] C locale set to C 14:46:36.461 INFO : [main] C++ locale set to C 14:46:36.461 INFO : SDL version used during compile is 2.0.14 14:46:36.461 INFO : SDL version used during linking and in runtime is 2.0.14 14:46:36.492 INFO : Number of render drivers on your system: 5 14:46:36.492 INFO : Render driver: 0/direct3d 14:46:36.492 INFO : Render driver: 1/direct3d11 14:46:36.492 INFO : Render driver: 2/opengl 14:46:36.492 INFO : Render driver: 3/opengles2 14:46:36.492 INFO : Render driver: 4/software 14:46:36.497 INFO : [options] C locale set to C 14:46:36.497 INFO : [options] C++ locale set to C 14:46:36.497 INFO : Setting language to: 'en' 14:46:36.497 INFO : [i18n] Scanning core translations from lang/mo/ 14:46:36.497 INFO : [i18n] Scanning mod translations from ./mods/ 14:46:36.497 WARNING : opendir [./mods/] failed with "No such process". 14:46:36.594 INFO : Active renderer: 1/direct3d11 14:46:36.723 INFO : USE_COLOR_MODULATED_TEXTURES is set to 0 14:46:36.733 INFO : Setting language to: 'en' 14:46:36.771 WARNING : opendir [./mods] failed with "No such process". 14:46:40.256 WARNING : opendir [./save/Somers/mods] failed with "No such process". 14:46:40.970 INFO : src/mod_tracker.h:70: Tried check if 'FakeSpecial_s_gas' had a duplicate, but type 'overmap_special' does not track object sources 14:46:48.378 INFO : Loaded tileset: UltimateCataclysm 14:46:48.555 INFO : Loaded tileset: UltimateCataclysm 14:46:52.606 ERROR : (error message will follow backtrace) #0 (dbghelp: @0x7ff611014710[cataclysm-tiles.exe+0x234710]), (libbacktrace: debug_write_backtrace(std::ostream&)+0x9e@0x140234710), 0x140234710 src/debug.cpp:1119 debug_write_backtrace(std::ostream&) #1 (dbghelp: @0x7ff611015564[cataclysm-tiles.exe+0x235564]), (libbacktrace: DebugLog(DebugLevel, DebugClass)+0x20e@0x140235564), 0x140235564 /opt/mxe/usr/x86_64-w64-mingw32.static.gcc11/include/time.h:230 time 0x140235564 src/debug.cpp:1447 DebugLog(DebugLevel, DebugClass) #2 (dbghelp: @0x7ff6110165be[cataclysm-tiles.exe+0x2365be]), (libbacktrace: realDebugmsg(char const*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&)+0x1ac@0x1402365be), 0x1402365be src/debug.cpp:508 realDebugmsg(char const*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&) #3 (dbghelp: @0x7ff611f4683d[cataclysm-tiles.exe+0x116683d]), (libbacktrace: item_location::impl::item_on_person::ensure_who_unpacked() const+0xcd@0x14116683d), 0x14116683d /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/basic_string.h:671 std::__cxx11::basic_string, std::allocator >::~basic_string() 0x14116683d src/debug.h:78 void realDebugmsg(char const*, char const*, char const*, char const*, int&&) 0x14116683d src/item_location.cpp:300 item_location::impl::item_on_person::ensure_who_unpacked() const 0x14116683d src/item_location.cpp:295 item_location::impl::item_on_person::ensure_who_unpacked() const #4 (dbghelp: @0x7ff611f468cd[cataclysm-tiles.exe+0x11668cd]), (libbacktrace: item_location::impl::item_on_person::valid() const+0xd@0x1411668cd), 0x1411668cd src/item_location.cpp:432 item_location::impl::item_on_person::valid() const #5 (dbghelp: @0x7ff611286c62[cataclysm-tiles.exe+0x4a6c62]), (libbacktrace: item_location::deserialize(JsonObject const&)+0x4ac@0x1404a6c62), 0x1404a6c62 src/item_location.cpp:808 item_location::deserialize(JsonObject const&) #6 (dbghelp: @0x7ff611fdb544[cataclysm-tiles.exe+0x11fb544]), (libbacktrace: decltype ((({parm#1}.deserialize)(*this)),(true)) JsonValue::read(item_location&, bool) const+0x34@0x1411fb544), 0x1411fb544 src/flexbuffer_json-inl.h:317 decltype ((({parm#1}.deserialize)(*this)),(true)) JsonValue::read(item_location&, bool) const #7 (dbghelp: @0x7ff6116eb7af[cataclysm-tiles.exe+0x90b7af]), (libbacktrace: player_activity::deserialize(JsonObject const&)+0xb59@0x14090b7af), 0x14090b7af src/flexbuffer_json-inl.h:381 decltype ((({parm#1}.front)()),(true)) JsonValue::read >, (void*)0>(std::vector >&, bool) const 0x14090b7af src/flexbuffer_json-inl.h:1143 bool JsonObject::read > >(char const*, std::vector >&, bool) const 0x14090b7af src/savegame_json.cpp:402 player_activity::deserialize(JsonObject const&) #8 (dbghelp: @0x7ff611fdbb44[cataclysm-tiles.exe+0x11fbb44]), (libbacktrace: decltype ((({parm#1}.deserialize)(*this)),(true)) JsonValue::read(player_activity&, bool) const+0x34@0x1411fbb44), 0x1411fbb44 src/flexbuffer_json-inl.h:317 decltype ((({parm#1}.deserialize)(*this)),(true)) JsonValue::read(player_activity&, bool) const #9 (dbghelp: @0x7ff6116facdd[cataclysm-tiles.exe+0x91acdd]), (libbacktrace: Character::load(JsonObject const&)+0x13a3@0x14091acdd), 0x14091acdd src/flexbuffer_json-inl.h:381 decltype ((({parm#1}.front)()),(true)) JsonValue::read >, (void*)0>(std::__cxx11::list >&, bool) const 0x14091acdd src/flexbuffer_json-inl.h:1143 bool JsonObject::read > >(char const*, std::__cxx11::list >&, bool) const 0x14091acdd src/savegame_json.cpp:729 Character::load(JsonObject const&) #10 (dbghelp: @0x7ff611700131[cataclysm-tiles.exe+0x920131]), (libbacktrace: avatar::load(JsonObject const&)+0x23@0x140920131), 0x140920131 src/savegame_json.cpp:1609 avatar::load(JsonObject const&) #11 (dbghelp: @0x7ff6116d45ce[cataclysm-tiles.exe+0x8f45ce]), (libbacktrace: game::unserialize(std::istream&, cata_path const&)+0x6fa@0x1408f45ce), 0x1408f45ce src/flexbuffer_json-inl.h:317 decltype ((({parm#1}.deserialize)(*this)),(true)) JsonValue::read(avatar&, bool) const 0x1408f45ce src/flexbuffer_json-inl.h:1143 bool JsonObject::read(char const*, avatar&, bool) const 0x1408f45ce src/savegame.cpp:264 game::unserialize(std::istream&, cata_path const&) #12 (dbghelp: @0x7ff610f00197[cataclysm-tiles.exe+0x120197]), (libbacktrace: read_from_file(ghc::filesystem::path const&, std::function const&)+0x46@0x140120197), 0x140120197 src/cata_utility.cpp:426 read_from_file(ghc::filesystem::path const&, std::function const&) #13 (dbghelp: @0x7ff610f002dd[cataclysm-tiles.exe+0x1202dd]), (libbacktrace: read_from_file(cata_path const&, std::function const&)+0x26@0x1401202dd), 0x1401202dd src/cata_utility.cpp:411 read_from_file(cata_path const&, std::function const&) #14 (dbghelp: @0x7ff611141a5c[cataclysm-tiles.exe+0x361a5c]), (libbacktrace: game::load(save_t const&)+0x1d6@0x140361a5c), 0x140361a5c src/game.cpp:2765 game::load(save_t const&) #15 (dbghelp: @0x7ff61135eca3[cataclysm-tiles.exe+0x57eca3]), (libbacktrace: main_menu::load_game(std::__cxx11::basic_string, std::allocator > const&, save_t const&)+0xd7@0x14057eca3), 0x14057eca3 src/main_menu.cpp:1029 main_menu::load_game(std::__cxx11::basic_string, std::allocator > const&, save_t const&) #16 (dbghelp: @0x7ff61135f3f5[cataclysm-tiles.exe+0x57f3f5]), (libbacktrace: main_menu::load_character_tab(std::__cxx11::basic_string, std::allocator > const&)+0x6a5@0x14057f3f5), 0x14057f3f5 src/main_menu.cpp:1067 main_menu::load_character_tab(std::__cxx11::basic_string, std::allocator > const&) #17 (dbghelp: @0x7ff611362bba[cataclysm-tiles.exe+0x582bba]), (libbacktrace: main_menu::opening_screen()+0x10c8@0x140582bba), 0x140582bba src/main_menu.cpp:854 main_menu::opening_screen() #18 (dbghelp: @0x7ff6123de9de[cataclysm-tiles.exe+0x15fe9de]), (libbacktrace: main+0x1d98@0x1415fe9de), 0x1415fe9de src/main.cpp:812 main #19 (dbghelp: @0x7ff610de13c1[cataclysm-tiles.exe+0x13c1]), (libbacktrace: _tmainCRTStartup+0x231@0x1400013c1), 0x1400013c1 /opt/mxe/tmp-gcc-x86_64-w64-mingw32.static.gcc11/gcc-11.2.0.build_/mingw-w64-v9.0.0/mingw-w64-crt/crt/crtexe.c:323 __tmainCRTStartup #20 (dbghelp: @0x7ff610de14d6[cataclysm-tiles.exe+0x14d6]), (libbacktrace: WinMainCRTStartup+0x16@0x1400014d6), 0x1400014d6 /opt/mxe/tmp-gcc-x86_64-w64-mingw32.static.gcc11/gcc-11.2.0.build_/mingw-w64-v9.0.0/mingw-w64-crt/crt/crtexe.c:178 WinMainCRTStartup #21 (dbghelp: BaseThreadInitThunk+0x14@0x7ff8ce1c7614[KERNEL32.DLL+0x17614]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), #22 (dbghelp: RtlUserThreadStart+0x21@0x7ff8ce8026a1[ntdll.dll+0x526a1]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), Backtrace emission took 1 seconds. (continued from above) ERROR : src/item_location.cpp:300 [bool item_location::impl::item_on_person::ensure_who_unpacked() const] Failed to find item_location owner with character_id 1 14:46:56.480 ERROR : src/item_location.cpp:300 [bool item_location::impl::item_on_person::ensure_who_unpacked() const] Failed to find item_location owner with character_id 1 14:46:56.480 ERROR : src/item_location.cpp:116 [void item_location::impl::ensure_unpacked() const] item_location lost its target item during a save/load cycle 14:46:57.456 ERROR : src/item_location.cpp:809 [void item_location::deserialize(const JsonObject&)] parent location does not point to valid item 14:54:45.739 : GAME REPORT: - OS: Windows - OS Version: 10.0.19044.2364 (21H2) - Game Version: ba42c0a [64-bit] - Graphics Version: Tiles - Game Language: System language [] - Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], No Fungal Growth [no_fungal_growth], Bionic Professions [package_bionic_professions] ] 14:56:57.931 ERROR : (error message will follow backtrace) #0 (dbghelp: @0x7ff611014710[cataclysm-tiles.exe+0x234710]), (libbacktrace: debug_write_backtrace(std::ostream&)+0x9e@0x140234710), 0x140234710 src/debug.cpp:1119 debug_write_backtrace(std::ostream&) #1 (dbghelp: @0x7ff611015564[cataclysm-tiles.exe+0x235564]), (libbacktrace: DebugLog(DebugLevel, DebugClass)+0x20e@0x140235564), 0x140235564 /opt/mxe/usr/x86_64-w64-mingw32.static.gcc11/include/time.h:230 time 0x140235564 src/debug.cpp:1447 DebugLog(DebugLevel, DebugClass) #2 (dbghelp: @0x7ff6110165be[cataclysm-tiles.exe+0x2365be]), (libbacktrace: realDebugmsg(char const*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&)+0x1ac@0x1402365be), 0x1402365be src/debug.cpp:508 realDebugmsg(char const*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&) #3 (dbghelp: @0x7ff611c61c1f[cataclysm-tiles.exe+0xe81c1f]), (libbacktrace: void realDebugmsg<>(char const*, char const*, char const*, char const*)+0x4f@0x140e81c1f), 0x140e81c1f /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/basic_string.h:671 std::__cxx11::basic_string, std::allocator >::~basic_string() 0x140e81c1f src/debug.h:78 void realDebugmsg<>(char const*, char const*, char const*, char const*) #4 (dbghelp: @0x7ff611f46dbc[cataclysm-tiles.exe+0x1166dbc]), (libbacktrace: item_location::impl::ensure_unpacked() const+0x6c@0x141166dbc), 0x141166dbc src/item_location.cpp:118 item_location::impl::ensure_unpacked() const #5 (dbghelp: @0x7ff611f47c6d[cataclysm-tiles.exe+0x1167c6d]), (libbacktrace: item_location::impl::target() const+0xd@0x141167c6d), 0x141167c6d src/item_location.cpp:102 item_location::impl::target() const #6 (dbghelp: @0x7ff611f46566[cataclysm-tiles.exe+0x1166566]), (libbacktrace: item_location::impl::item_on_map::serialize(JsonOut&) const+0x96@0x141166566), 0x141166566 src/item_location.cpp:202 item_location::impl::item_on_map::serialize(JsonOut&) const #7 (dbghelp: @0x7ff6116e12f0[cataclysm-tiles.exe+0x9012f0]), (libbacktrace: player_activity::serialize(JsonOut&) const+0x28e@0x1409012f0), 0x1409012f0 src/json.h:778 decltype ((({parm#1}.serialize)(*this)),((void)())) JsonOut::write(item_location const&) 0x1409012f0 src/json.h:848 void JsonOut::write_as_array > >(std::vector > const&) 0x1409012f0 src/json.h:859 decltype ((({parm#1}.front)()),((void)(0))) JsonOut::write >, (void*)0>(std::vector > const&) 0x1409012f0 src/json.h:927 void JsonOut::member > >(std::__cxx11::basic_string, std::allocator > const&, std::vector > const&) 0x1409012f0 src/savegame_json.cpp:341 player_activity::serialize(JsonOut&) const #8 (dbghelp: @0x7ff6116f1b38[cataclysm-tiles.exe+0x911b38]), (libbacktrace: Character::store(JsonOut&) const+0x87e@0x140911b38), 0x140911b38 /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/stl_list.h:305 std::_List_const_iterator::operator++() 0x140911b38 src/json.h:847 void JsonOut::write_as_array > >(std::__cxx11::list > const&) 0x140911b38 src/json.h:859 decltype ((({parm#1}.front)()),((void)(0))) JsonOut::write >, (void*)0>(std::__cxx11::list > const&) 0x140911b38 src/json.h:927 void JsonOut::member > >(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::list > const&) 0x140911b38 src/savegame_json.cpp:1348 Character::store(JsonOut&) const #9 (dbghelp: @0x7ff6116f379a[cataclysm-tiles.exe+0x91379a]), (libbacktrace: avatar::store(JsonOut&) const+0x1c@0x14091379a), 0x14091379a src/savegame_json.cpp:1532 avatar::store(JsonOut&) const #10 (dbghelp: @0x7ff6116f3e17[cataclysm-tiles.exe+0x913e17]), (libbacktrace: avatar::serialize(JsonOut&) const+0x23@0x140913e17), 0x140913e17 src/savegame_json.cpp:1524 avatar::serialize(JsonOut&) const #11 (dbghelp: @0x7ff6116d01c3[cataclysm-tiles.exe+0x8f01c3]), (libbacktrace: game::serialize(std::ostream&)+0x5c3@0x1408f01c3), 0x1408f01c3 /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/basic_string.h:671 std::__cxx11::basic_string, std::allocator >::~basic_string() 0x1408f01c3 src/savegame.cpp:129 game::serialize(std::ostream&) #12 (dbghelp: @0x7ff610f00a9a[cataclysm-tiles.exe+0x120a9a]), (libbacktrace: write_to_file(std::__cxx11::basic_string, std::allocator > const&, std::function const&)+0x49@0x140120a9a), 0x140120a9a src/cata_utility.cpp:270 write_to_file(std::__cxx11::basic_string, std::allocator > const&, std::function const&) #13 (dbghelp: @0x7ff610f00af3[cataclysm-tiles.exe+0x120af3]), (libbacktrace: write_to_file(std::__cxx11::basic_string, std::allocator > const&, std::function const&, char const*)+0x16@0x140120af3), 0x140120af3 src/cata_utility.cpp:278 write_to_file(std::__cxx11::basic_string, std::allocator > const&, std::function const&, char const*) #14 (dbghelp: @0x7ff6110fccec[cataclysm-tiles.exe+0x31ccec]), (libbacktrace: game::save_player_data()+0xce@0x14031ccec), 0x14031ccec /opt/mxe/usr/lib/gcc/x86_64-w64-mingw32.static.gcc11/11.2.0/include/c++/bits/basic_string.h:671 std::__cxx11::basic_string, std::allocator >::~basic_string() 0x14031ccec src/game.cpp:2976 game::save_player_data() #15 (dbghelp: @0x7ff61112b2bd[cataclysm-tiles.exe+0x34b2bd]), (libbacktrace: game::save()+0x1c1@0x14034b2bd), 0x14034b2bd src/game.cpp:3062 game::save() #16 (dbghelp: @0x7ff6111753a0[cataclysm-tiles.exe+0x3953a0]), (libbacktrace: game::do_regular_action(action_id&, avatar&, cata::optional const&)+0x3bc2@0x1403953a0), 0x1403953a0 src/handle_action.cpp:2509 game::do_regular_action(action_id&, avatar&, cata::optional const&) #17 (dbghelp: @0x7ff611177950[cataclysm-tiles.exe+0x397950]), (libbacktrace: game::handle_action()+0xb52@0x140397950), 0x140397950 src/handle_action.cpp:2970 game::handle_action() #18 (dbghelp: @0x7ff61106357c[cataclysm-tiles.exe+0x28357c]), (libbacktrace: do_turn()+0x62f@0x14028357c), 0x14028357c src/do_turn.cpp:726 do_turn() #19 (dbghelp: @0x7ff6123deac6[cataclysm-tiles.exe+0x15feac6]), (libbacktrace: main+0x1e80@0x1415feac6), 0x1415feac6 src/main.cpp:817 main #20 (dbghelp: @0x7ff610de13c1[cataclysm-tiles.exe+0x13c1]), (libbacktrace: _tmainCRTStartup+0x231@0x1400013c1), 0x1400013c1 /opt/mxe/tmp-gcc-x86_64-w64-mingw32.static.gcc11/gcc-11.2.0.build_/mingw-w64-v9.0.0/mingw-w64-crt/crt/crtexe.c:323 __tmainCRTStartup #21 (dbghelp: @0x7ff610de14d6[cataclysm-tiles.exe+0x14d6]), (libbacktrace: WinMainCRTStartup+0x16@0x1400014d6), 0x1400014d6 /opt/mxe/tmp-gcc-x86_64-w64-mingw32.static.gcc11/gcc-11.2.0.build_/mingw-w64-v9.0.0/mingw-w64-crt/crt/crtexe.c:178 WinMainCRTStartup #22 (dbghelp: BaseThreadInitThunk+0x14@0x7ff8ce1c7614[KERNEL32.DLL+0x17614]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), #23 (dbghelp: RtlUserThreadStart+0x21@0x7ff8ce8026a1[ntdll.dll+0x526a1]), (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable), (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable), Backtrace emission took 0 seconds. (continued from above) ERROR : src/item_location.cpp:116 [void item_location::impl::ensure_unpacked() const] item_location lost its target item during a save/load cycle 14:57:05.723 WARNING : opendir [./save/Somers/mods] failed with "No such process". 14:57:11.479 INFO : Loaded tileset: UltimateCataclysm 14:57:11.479 INFO : Loaded tileset: UltimateCataclysm 14:57:19.630 : Log shutdown. ----------------------------------------- ```

Savefile: Somers-bug.zip

mqrause commented 1 year ago

The errors come from trying to load a washing activity, so something went wrong with that. Trying to find out what exactly might be a bit harder. Somehow it seems to have been finished but was still around when the game saved later.

grafik

Also interesting the last entry in the log is picking up a washboard. But that's not necessarily related.

moxian commented 1 year ago

Oh, i have context on that then!

I was washing the items with the water from the pond (east of the house), while being inside the house itself. I was getting interrupted by seeing crawling zombie. I pressed "don't stop washing" a couple of times (didn't click "ignore all distractions" since i didn't feel very safe about that), but then gave a try to the distraction Manager thing. After seeing its interface, i realized that it probably doesn't do what i want it do, and pressed Esc. That made me stop washing, and i had to restart the process anew.

Probably that leftover washing interrupted by opening the Manager and pressing Esc is the culprit.

mqrause commented 1 year ago

Okay, the activity is still there (on the backlog) after cancelling because it's a suspendable activity. However with the way it's assigned it can never actually resume the previous activity because the activity targets are only set after the activity is assigned. Assigning the activity compares targets to determine if it can resume an activity from the backlog which fails because the new one doesn't have any targets, yet. So the now stale activity sits in the backlog until that's cleared.

However looking at that info and the crash log, I'm fairly confident the issue is item_location::impl::item_in_container::calc_index unsafely accessing the container, which can be invalidated by actions taken after the activity was suspended. Basically when you washed the military rucksack, it was in the backpack and that state got saved in the activity. Then you wore the rucksack and took off the backpack, so the saved container of the rucksack isn't valid anymore. And the the serialization code for the activity tries to access the now invalid backpack location and crashes.