Segmentation Fault - 0.E-4920-g6a34646 - Loading into game

Hi all, got another segmentation error. This fault was given to me as I was logging into my main character an hour after I’d initially closed out the game. I saved and quit inside a sewage treatment facility, ground floor, which I was using as a base. I am now unable to load past the loading screen as the game crashes right after all the tiles and mods are loaded and right before I can see the game world.

I was kinda hoping to see if there is any way to fix the issue without having to reload several hours of progress. Here’s what the crash log has:

The program has crashed.
See the log file for a stack trace.
CRASH LOG FILE: ./config/crash.log
VERSION: 0.E-4920-g6a34646
TYPE: Signal
MESSAGE: SIGSEGV: Segmentation fault
STACK TRACE:

  #0
    (dbghelp: @0x66f436[cataclysm-tiles.exe+0x26f436]), 
    (libbacktrace: Z21debug_write_backtraceRSo+0x56@0x66f436),
    (libbacktrace: 0x66f436    [unknown src]:0    [unknown func]),
  #1
    (dbghelp: @0x64d90f[cataclysm-tiles.exe+0x24d90f]), 
    (libbacktrace: log_crash+0x4af@0x64d90f),
    (libbacktrace: 0x64d90f    [unknown src]:0    [unknown func]),
  #2
    (dbghelp: @0x64e5e2[cataclysm-tiles.exe+0x24e5e2]), 
    (libbacktrace: signal_handler+0x32@0x64e5e2),
    (libbacktrace: 0x64e5e2    [unknown src]:0    [unknown func]),
  #3
    (dbghelp: SMPEG_error+0x4b034@0x112b9b0[cataclysm-tiles.exe+0xd2b9b0]), 
    (libbacktrace: gnu_exception_handler+0x70@0x112b9b0),
    (libbacktrace: 0x112b9b0    /home/narc/src/mxe/tmp-gcc-x86_64-w64-mingw32.static/gcc-5.4.0.build_/mingw-w64-v5.0.2/mingw-w64-crt/crt/crt_handler.c:223    _gnu_exception_handler),
  #4
    (dbghelp: _C_specific_handler+0x98@0x7ffecdcd7ff8[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@0x7ffece5500ef[ntdll.dll+0xa00ef]), 
    (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@0x7ffece4fb474[ntdll.dll+0x4b474]), 
    (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@0x7ffece54ec1e[ntdll.dll+0x9ec1e]), 
    (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: @0x86a457[cataclysm-tiles.exe+0x46a457]), 
    (libbacktrace: ZN4item18get_safe_referenceEv+0x7@0x86a457),
    (libbacktrace: 0x86a457    [unknown src]:0    [unknown func]),
  #9
    (dbghelp: @0x909b06[cataclysm-tiles.exe+0x509b06]), 
    (libbacktrace: ZN13item_location11deserializeER6JsonIn+0x736@0x909b06),
    (libbacktrace: 0x909b06    [unknown src]:0    [unknown func]),
  #10
    (dbghelp: IMG_LoadWEBP_RW+0x365623@0x1582e43[cataclysm-tiles.exe+0x1182e43]), 
    (libbacktrace: ZN6JsonIn4readISt6vectorI13item_locationSaIS2_EELPv0EEEDTcmcldtfp_5frontELb1EERT_b+0x193@0x1582e43),
    (libbacktrace: 0x1582e43    [unknown src]:0    [unknown func]),
  #11
    (dbghelp: @0xebb560[cataclysm-tiles.exe+0xabb560]), 
    (libbacktrace: ZN15player_activity11deserializeER6JsonIn+0x8b0@0xebb560),
    (libbacktrace: 0xebb560    [unknown src]:0    [unknown func]),
  #12
    (dbghelp: IMG_LoadWEBP_RW+0x35672f@0x1573f4f[cataclysm-tiles.exe+0x1173f4f]), 
    (libbacktrace: ZN6JsonIn4readINSt7__cxx114listI15player_activitySaIS3_EEELPv0EEEDTcmcldtfp_5frontELb1EERT_b+0xff@0x1573f4f),
    (libbacktrace: 0x1573f4f    [unknown src]:0    [unknown func]),
  #13
    (dbghelp: @0xec0270[cataclysm-tiles.exe+0xac0270]), 
    (libbacktrace: ZN9Character4loadERK10JsonObject+0x47f0@0xec0270),
    (libbacktrace: 0xec0270    [unknown src]:0    [unknown func]),
  #14
    (dbghelp: @0xec1c2b[cataclysm-tiles.exe+0xac1c2b]), 
    (libbacktrace: ZN6player4loadERK10JsonObject+0x2b@0xec1c2b),
    (libbacktrace: 0xec1c2b    [unknown src]:0    [unknown func]),
  #15
    (dbghelp: @0xec387b[cataclysm-tiles.exe+0xac387b]), 
    (libbacktrace: ZN6avatar4loadERK10JsonObject+0x2b@0xec387b),
    (libbacktrace: 0xec387b    [unknown src]:0    [unknown func]),
  #16
    (dbghelp: @0xec59b4[cataclysm-tiles.exe+0xac59b4]), 
    (libbacktrace: ZN6avatar11deserializeER6JsonIn+0x24@0xec59b4),
    (libbacktrace: 0xec59b4    [unknown src]:0    [unknown func]),
  #17
    (dbghelp: @0xe8c3ff[cataclysm-tiles.exe+0xa8c3ff]), 
    (libbacktrace: ZN4game11unserializeERSi+0xecf@0xe8c3ff),
    (libbacktrace: 0xe8c3ff    [unknown src]:0    [unknown func]),
  #18
    (dbghelp: @0x557683[cataclysm-tiles.exe+0x157683]), 
    (libbacktrace: Z14read_from_fileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt8functionIFvRSiEE+0x143@0x557683),
    (libbacktrace: 0x557683    [unknown src]:0    [unknown func]),
  #19
    (dbghelp: @0x79d853[cataclysm-tiles.exe+0x39d853]), 
    (libbacktrace: ZN4game4loadERK6save_t+0xa93@0x79d853),
    (libbacktrace: 0x79d853    [unknown src]:0    [unknown func]),
  #20
    (dbghelp: @0xa137c7[cataclysm-tiles.exe+0x6137c7]), 
    (libbacktrace: ZN9main_menu18load_character_tabEb+0x577@0xa137c7),
    (libbacktrace: 0xa137c7    [unknown src]:0    [unknown func]),
  #21
    (dbghelp: @0xa1c737[cataclysm-tiles.exe+0x61c737]), 
    (libbacktrace: ZN9main_menu14opening_screenEv+0xdc7@0xa1c737),
    (libbacktrace: 0xa1c737    [unknown src]:0    [unknown func]),
  #22
    (dbghelp: IMG_LoadWEBP_RW+0x743d65@0x1961585[cataclysm-tiles.exe+0x1561585]), 
    (libbacktrace: main+0x16d5@0x1961585),
    (libbacktrace: 0x1961585    [unknown src]:0    [unknown func]),
  #23
    (dbghelp: @0x4013ed[cataclysm-tiles.exe+0x13ed]), 
    (libbacktrace: _tmainCRTStartup+0x23d@0x4013ed),
    (libbacktrace: 0x4013ed    /home/narc/src/mxe/tmp-gcc-x86_64-w64-mingw32.static/gcc-5.4.0.build_/mingw-w64-v5.0.2/mingw-w64-crt/crt/crtexe.c:336    __tmainCRTStartup),
  #24
    (dbghelp: @0x4014fb[cataclysm-tiles.exe+0x14fb]), 
    (libbacktrace: WinMainCRTStartup+0x1b@0x4014fb),
    (libbacktrace: 0x4014fb    /home/narc/src/mxe/tmp-gcc-x86_64-w64-mingw32.static/gcc-5.4.0.build_/mingw-w64-v5.0.2/mingw-w64-crt/crt/crtexe.c:186    WinMainCRTStartup),
  #25
    (dbghelp: BaseThreadInitThunk+0x14@0x7ffecc546fd4[KERNEL32.DLL+0x16fd4]), 
    (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),
  #26
    (dbghelp: RtlUserThreadStart+0x21@0x7ffece4fcec1[ntdll.dll+0x4cec1]), 
    (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),

Looks like it tries to load an item and/or a location of an item (and fails)…

Do you use any mods?
" the launcher?

Yeah, I use the CDDA game launcher and a couple of mods:

-Disable NPC Needs
-Aftershock
-Blaze Industries
-No Freeze
-Dinomod
-Mining Mod
-Graphical Overmap
-MSX Alternative Floor Tiles
-MSX Hide Debug
-MSX Hide Status
-MSX Indicators: REMIX
-Fuji’s Military Professions Pack
-Necropolis actually findable
-Sees-player icon, retrodays
-sees-player icon, hitbutton_iso

So I’d went through and disabled everything except the core game and it still results in a segmentation fault.

…It’s especially weird since missing items usually only produce a warning and might generate nones, not a crash.

Did you update the game since you’ve last save it?

I have updated the game twice since last attempting to play it. However, I do not recall if there was a patch between the hour I stopped playing and resumed when I discovered the error.

Hm, it’s quite possible that an update broke something.

Sadly, I don’t see any way to fix this or even a concrete cause.
You could try to edit the save file and look for anything weird, but without any clue on what caused it in the first place, it’s highly unlikely to find a fix for it.

If you’re really desperate to get this save back, you could zip it and upload it somewhere (or attach it to an email, address on request) and I’ll see what I can do, but I can’t promise anything (and if I’m able to repair it, it might still take me a while to figure it out in the first place)…

I’m not the best at fixing these kinds of things on my own, though I did fix one game breaking error once before.

I am fairly desperate to get my save back, and I did backup my save and it’s subsequent backups in case I take a stab at fixing it and I break more than I can fix. If you’d like to try or know a place I can get help, I’d be more than willing to have that assistance.

Actually, it seems like there’s an other person having the same issues that you have (unless that’s your report):

You can try the fix attached there, but if you’re not familiar with coding you can send me the save per email (I’ll send you my address in a private message).

Nah, that one isn’t mine, but I did post once about this fault last month. The last segmentation fault I’d had was in a FEMA camp, and some of the values mentioned in the crash log then were similar to the ones I’m getting now.

That’s my bug report over on Github – apparently my segfault issue was caused by my preparing a “Deluxe Vegetarian Beans & Rice” recipe which somehow managed to remove the beans from the tin can while leaving the can “sealed”. It didn’t actually crash while I was playing, I saved & quit sometime after that… and then got the segfault when I tried to load up that save later. Any chance yours is something similar?

Mine is similar, but unfortunately I’m not really sure what caused it. I was in a base I relocated to, a sewage treatment facility. I keep a lot of items nearby for crafting and whatnot, and I was standing in the kitchen area I created on the surface level, next to a mini-fridge and a kitchen unit I’d installed on a wire grid. I think I just finished adding more wires to my solar grid, or just boiled some drinking water before I saved and quit.

I had the exact same issue, fairly new CDDA player made it almost a month in my current game (longest yet) and as I was learning and eventually figured out how to use Item sorting through the Zone (Y and O to sort) feature my game crashed. Same as you my character was duplicated and whenever I load up the file I crash.

It’s bizarre because this is the second time I’ve experienced this issue, the last time I avoided it altogether by loading a slightly older backup that hadn’t been far off from when I was getting the error. I just want to know why it’s occurring, how to fix it, and how to avoid it from here on out.

Here’s what I found in my debug if it’s worth anything to anyone:

-----------------------------------------
18:13:31.460 : Starting log.
18:13:31.462 INFO : Cataclysm DDA version 0.E-4951-g9af1a35
18:13:31.476 INFO : [main] C locale set to C
18:13:31.477 INFO : [main] C++ locale set to C
18:13:31.477 INFO : SDL version used during compile is 2.0.5
18:13:31.477 INFO : SDL version used during linking and in runtime is 2.0.5
18:13:31.803 WARNING : opendir [./sound/] failed with "No such file or directory".
18:13:31.852 INFO : Number of render drivers on your system: 4
18:13:31.852 INFO : Render driver: 0/direct3d
18:13:31.852 INFO : Render driver: 1/direct3d11
18:13:31.852 INFO : Render driver: 2/opengl
18:13:31.852 INFO : Render driver: 3/software
18:13:31.863 INFO : [options] C locale set to C
18:13:31.863 INFO : [options] C++ locale set to C
18:13:31.882 INFO : Active renderer: 0/direct3d
18:13:32.538 INFO : USE_COLOR_MODULATED_TEXTURES is set to 0
18:13:32.821 INFO : Language is set to: 'en'
18:13:32.821 INFO : [translations] C locale set to English_United States.1252
18:13:32.821 INFO : [translations] C++ locale set to C
18:13:33.307 WARNING : opendir [./mods/] failed with "No such file or directory".
18:14:06.531 WARNING : opendir [./save/Skyforest/mods] failed with "No such file or directory".
18:14:15.266 ERROR SDL : (error message will follow backtrace)
  #0
    (dbghelp: @0x66f446[cataclysm-tiles.exe+0x26f446]), 
    (libbacktrace: Z21debug_write_backtraceRSo+0x56@0x66f446),
    (libbacktrace: 0x66f446    [unknown src]:0    [unknown func]),
  #1
    (dbghelp: @0x66feda[cataclysm-tiles.exe+0x26feda]), 
    (libbacktrace: Z8DebugLog10DebugLevel10DebugClass+0x34a@0x66feda),
    (libbacktrace: 0x66feda    [unknown src]:0    [unknown func]),
  #2
    (dbghelp: @0x54a384[cataclysm-tiles.exe+0x14a384]), 
    (libbacktrace: ZN14tileset_loader4loadERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0xa54@0x54a384),
    (libbacktrace: 0x54a384    [unknown src]:0    [unknown func]),
  #3
    (dbghelp: @0x54c275[cataclysm-tiles.exe+0x14c275]), 
    (libbacktrace: ZN10cata_tiles12load_tilesetERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbb+0x115@0x54c275),
    (libbacktrace: 0x54c275    [unknown src]:0    [unknown func]),
  #4
    (dbghelp: @0xee737a[cataclysm-tiles.exe+0xae737a]), 
    (libbacktrace: Z12load_tilesetv+0x6a@0xee737a),
    (libbacktrace: 0xee737a    [unknown src]:0    [unknown func]),
  #5
    (dbghelp: @0x82ad96[cataclysm-tiles.exe+0x42ad96]), 
    (libbacktrace: ZN17DynamicDataLoader20finalize_loaded_dataER10loading_ui+0x11f6@0x82ad96),
    (libbacktrace: 0x82ad96    [unknown src]:0    [unknown func]),
  #6
    (dbghelp: @0x78dab1[cataclysm-tiles.exe+0x38dab1]), 
    (libbacktrace: ZN4game19load_world_modfilesER10loading_ui+0x5f1@0x78dab1),
    (libbacktrace: 0x78dab1    [unknown src]:0    [unknown func]),
  #7
    (dbghelp: @0x7a457b[cataclysm-tiles.exe+0x3a457b]), 
    (libbacktrace: ZN4game5setupEv+0xdb@0x7a457b),
    (libbacktrace: 0x7a457b    [unknown src]:0    [unknown func]),
  #8
    (dbghelp: @0xa13b66[cataclysm-tiles.exe+0x613b66]), 
    (libbacktrace: ZN9main_menu18load_character_tabEb+0x556@0xa13b66),
    (libbacktrace: 0xa13b66    [unknown src]:0    [unknown func]),
  #9
    (dbghelp: @0xa1caf7[cataclysm-tiles.exe+0x61caf7]), 
    (libbacktrace: ZN9main_menu14opening_screenEv+0xdc7@0xa1caf7),
    (libbacktrace: 0xa1caf7    [unknown src]:0    [unknown func]),
  #10
    (dbghelp: IMG_LoadWEBP_RW+0x743e05@0x1962225[cataclysm-tiles.exe+0x1562225]), 
    (libbacktrace: main+0x16d5@0x1962225),
    (libbacktrace: 0x1962225    [unknown src]:0    [unknown func]),
  #11
    (dbghelp: @0x4013ed[cataclysm-tiles.exe+0x13ed]), 
    (libbacktrace: _tmainCRTStartup+0x23d@0x4013ed),
    (libbacktrace: 0x4013ed    /home/narc/src/mxe/tmp-gcc-x86_64-w64-mingw32.static/gcc-5.4.0.build_/mingw-w64-v5.0.2/mingw-w64-crt/crt/crtexe.c:336    __tmainCRTStartup),
  #12
    (dbghelp: @0x4014fb[cataclysm-tiles.exe+0x14fb]), 
    (libbacktrace: WinMainCRTStartup+0x1b@0x4014fb),
    (libbacktrace: 0x4014fb    /home/narc/src/mxe/tmp-gcc-x86_64-w64-mingw32.static/gcc-5.4.0.build_/mingw-w64-v5.0.2/mingw-w64-crt/crt/crtexe.c:186    WinMainCRTStartup),
  #13
    (dbghelp: BaseThreadInitThunk+0x14@0x7ffecc546fd4[KERNEL32.DLL+0x16fd4]), 
    (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),
  #14
    (dbghelp: RtlUserThreadStart+0x21@0x7ffece4fcec1[ntdll.dll+0x4cec1]), 
    (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.
src/cata_tiles.cpp:583: Mod tileset in "data/mods//sees_player_retro/mod_tileset.json" is not compatible.
18:14:16.275 ERROR SDL : src/cata_tiles.cpp:583: Mod tileset in "data/mods//sees_player_hitbutton/mod_tileset.json" is not compatible.
18:14:16.312 ERROR SDL : src/cata_tiles.cpp:622: tile explosion_weak has no (valid) foreground nor background
18:14:16.315 ERROR SDL : src/cata_tiles.cpp:622: tile explosion has no (valid) foreground nor background
18:14:16.316 ERROR SDL : src/cata_tiles.cpp:622: tile explosion_medium has no (valid) foreground nor background

So… I was able to fix up L11’s save manually…

Let me compose a little guide until this bug is fixed…

How to prevent this bug from happening:

  • Don’t eat/drink or cook before you save.

I’m not sure how many other actions it takes until it’s safe to… uhm… save. I’m not even sure what’s counting as an action to overwrite the buggy stuff…
I’d suggest doing one of these things after eating and before saving: reading (at least 1 chapter), crafting (probably don’t have to finish), constructing (probably don’t have to finish), sleeping (save after sleeping, not while laying down!).

It happend to me, what now?:

There are a lot of reasons for segmentation faults, so check to make sure if it’s actually this one. Compare your crash.log to the one in the first post of this topic.
Then, if you - for whatever reason - don’t want to use the fix suggested in the github issue, you can edit your save file like this:

  • Make a backup of your save folder, just in case something goes “even wronger”.
  • Open your save folder followed by the folder with the world name you’re playing on.
  • Look for the file that ends with a .sav (not master.gsav). You might have to set your file extensions to visible.
    • The file is usually one of the largest, so you could sort by file size.
    • If you have multipe characters in the world, make sure you grab the right one. You can copy the file name and past it into any base64 decoder (this one for example). If it matches the name of the character you try to load, you’ve found the right file.
      • Alternatively, look for the .log file with the same name as your .sav file (this might be the only one with no extension visible, depending on your settings). Open it and look for "[NAME] began their journey into the Cataclysm.". If the [NAME] of it is the name of the character you try to load, you’ve found the right file.
  • After you found the right .sav file, open it in a text editor of your choise.
  • Search for "backlog" (including the quotes!).
  • After that tag, you’ll find an opening bracket [. You now have to find it’s counterpart, the one closing it.
    • Sadly, that’s not going to be the closest ] you can find (if it is, then your segmentation fault was not caused by this…).
      • However, you can somehow mark your starting bracket (add some line breaks after it or something) and – unless something changes in the immediate future – search for "activity_vehicle_part_index". From there, go back a few symbols and you should run into a closing bracket ], the counterpart one from the "backlog" tag.
  • Now remove everything between these brackets. Afterwards, it should look like this:
  • […], "backlog": [], "activity_vehicle_part_index": […]
  • Save the file.
  • And now, give it a try :slight_smile: .

@Valase I’m not sure this bug is just related to eating & drinking. I was able to reproduce it on a fresh world/character by simply cooking “Beans & Rice” recipe using “Canned Beans” as an ingredient, then saving & trying to reload. I never actually ate the food, just cooked it & saved – got Segfault on attempting to load after that. I’m kinda leaning toward it being a problem with canned goods.

The last things L11’s character consumed (going by the log) were water and pork sticks, which, unless that changed, are not canned.
The backlog had a lot of hanging [ACT_EAT_FOOD] stuck in it.

However, I’ve added the cooking actions to the no-no list… It might be a problem with “things getting consumed” in any way, so I probably have to remove the suggestion of crafting and constructing (with materials) all together…

Edit:
I’ve just checked your backlog, @Kenneth_Ellis…:
It has three things stuck in it, ACT_CONSUME_DRINK_MENU, ACT_CONSUME_FOOD_MENU and ACT_CRAFT.
Your last actions were (aside from watching a bass swimming up and down a pool of water) to listen to music, seeing a tired NPC and reading…

So, I have no Idea how to prevent this segfault from happening, as you did a lot of things I’ve suggested…

It is a confusing one, for sure. I’ll try to do some more testing later this evening with different scenarios to try to narrow it down & will let you know if you come up with anything illuminating.

@Valase So I just updated to the latest build (10911) and now I can no longer reproduce the issue like I was able to before. I didn’t see anything in the changelog to indicate that it was fixed on purpose, but I can’t cause the segfault anymore. Curious if others get the same results.