Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Troubleshooting a save which keeps crashing  (Read 920 times)

chriswg

  • Escaped Lunatic
    • View Profile
Troubleshooting a save which keeps crashing
« on: July 22, 2020, 04:22:53 pm »

I have a save of a ~5 year old fortress which crashes quite often. I recently got to a point where my save consistently crashes about a minute after loading if I just let it run. I read that corrupted equipment can cause crashes so I tried forbidding absolutely every item via the stocks menu and the save seems to run without crashing. I was wondering if anyone have any tips for first finding the corrupted equipment / problem item and then how to deal with it (dump, some sort of DFHack script to remove it…)

I am on macOS Catalina version 10.15.5. I use the PyLNP 0.13b Lazy Mac Pack. When the game crashes the DFHack terminal displays a message like this:

[DFHack]# /Applications/Lazy Mac Pack v0.47.04 dfhack-b1/df_osx v0.47.04/dfhack: line 30: 56671 Segmentation fault: 11  DYLD_INSERT_LIBRARIES=./hack/libdfhack.dylib ./dwarfort.exe "$@"

Sometimes instead of segmentation fault: 11 it will say Bus error: 10
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Troubleshooting a save which keeps crashing
« Reply #1 on: July 23, 2020, 03:19:18 am »

The known way to detect equipment corruption is to go into the military equipment screen, go into the equipment selection for each type (Armor, Weapon...), and in each section select specific equipment. Go to the bottom of the specific equipment (go up wraps around) and check if there's something suspicious there (typically a book title). If there is something weird in any of the category the save is corrupted, with no known way to save the fortress except by disbanding all military personnel and never assign any ever again (and I'm not completely sure the invisible and unreachable job uniforms of hunters, miners, and wood cutters can't be corrupted).
A guess that's been floating around is that retiring and resuming a fortress might clear the corruption, but I don't know if it's been confirmed to work (and it's known that retiring/reclaiming has a lot of issues in itself).

If you have a save that crashes with a high degree of probability and you can't see any equipment corruption it would be useful to upload it to DFFD and post a bug report. If nothing else, it allows people to take a look at your save and try to figure out what's wrong (equipment corruption isn't the only known cause of crashes, and there are probably ones that haven't been identified).
Logged

chriswg

  • Escaped Lunatic
    • View Profile
Re: Troubleshooting a save which keeps crashing
« Reply #2 on: July 23, 2020, 08:14:22 am »

I can see a suspicious piece of equipment called Nonuöla Ozosangösm which appears twice at the bottom of the gloves equipment screen and once at the bottom of the weapon menu, and nothing happens if press enter while it is selected to ask it to be equipped. I suppose this confirms that it is the corrupted equipment bug.

Thank you for the suggestion and the general information about this bug.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Troubleshooting a save which keeps crashing
« Reply #3 on: July 23, 2020, 08:46:29 am »

Have you tried to actually find N.O. in the stocks menu (and just forbidding that, or the entire group of things it belongs to)?

It may be at least less-unplayable than forbidding everything, yet still as uncrashing. Though I agree it would be good to get it fixed, where possible, rather than living with it like that, so letting the resident boffins get at your savegame is still a good idea if you aren't averse to that.

(Do you have Seasonal Saves enabled? Good for investigation purposes if bugs and non-bug events alike, if set up in advance, and could mean you 'only' lose a year or less of gametime. You can have fun trying different things along the way to catch back up, assuming the bug isn't "inevitable", and if it is then that's important knowledge. If no saves, though, never mind but consider it for later.)
Logged

chriswg

  • Escaped Lunatic
    • View Profile
Re: Troubleshooting a save which keeps crashing
« Reply #4 on: July 23, 2020, 09:26:49 am »

@Starver

N.O. doesn't seem to exist in the stocks menu, unless it is there but doesn't appear when searched for. Looking for it manually would be beyond me (26000 items to wade through) but I can't see it in the weapons or handwear sections.

Unfortunately I didn't realise there was a backup save feature in DFHack until you mentioned it, I have seasonal autosave on (but I don't think that makes backups unless backup saves is also on). I will definitely use this on my next fort.
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Troubleshooting a save which keeps crashing
« Reply #5 on: July 23, 2020, 11:36:47 am »

If the same item is in two different sections it's definitely bugged. Most of those random artifacts are "books" created early in history and which have never been in the fortress, so I suspect it wouldn't even matter if for some weird reason the item was present, as the reference is a random value, essentially.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Troubleshooting a save which keeps crashing
« Reply #6 on: July 23, 2020, 11:06:56 pm »

Unfortunately I didn't realise there was a backup save feature in DFHack until you mentioned it, I have seasonal autosave on (but I don't think that makes backups unless backup saves is also on). I will definitely use this on my next fort.
Automatic save backups have been part of vanilla Dwarf Fortress since version 0.27.169.32a (i.e. the version that introduced Z-levels in Fortress mode), configured at the top of data/init/d_init.txt (though back then it was in init.txt). As far as I'm aware, the only thing DFHack adds is the ability to "quicksave" on demand without creating a backup.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

chriswg

  • Escaped Lunatic
    • View Profile
Re: Troubleshooting a save which keeps crashing
« Reply #7 on: July 24, 2020, 05:23:29 am »

@Quietust Thanks, I see that now, though I hadn't activated it. I thought DFHack offered the option since I spotted a button on Lazy Mac Pack which says it backs up saves but I now suppose that is actually just editing the init file for me.
Logged