View Issue Details

IDProjectCategoryView StatusLast Update
0006681Dwarf FortressTechnical -- Generalpublic2014-07-18 13:02
ReporterArmokGoB Assigned ToToady One  
PriorityhighSeveritycrashReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformWindowsOSWindows 7 64-BitOS Version6.1
Product Version0.40.01 
Fixed in Version0.40.02 
Summary0006681: Autosave causes save corruption and crashes on load
DescriptionI have noticed that the game tends to crash on load if a player fort exists in it. It doesn't matter if it's active, retired, or abandoned.
Additional InformationSave file with abandoned fortress: https://dl.dropboxusercontent.com/u/87322559/DF%20Crash.zip

I have tried each method, but have not tried to reproduce any of them.
TagsNo tags attached.

Relationships

has duplicate 0006687 resolveduser11 Game won't load saved world [Fortress Mode / Agreements] 
has duplicate 0006624 resolveduser6 Crash on loading save file in Fortress mode (Track Information) 
has duplicate 0006661 resolveduser11 Crash when loading [Fortress Mode / Cultural Identities] 
has duplicate 0006609 resolveduser6 Dwarf Mode frequently crashes shortly after loading a saved game 
has duplicate 0006606 resolveduser11 starting a new game in a world with a retired (not abandoned) fort causes a crash 
has duplicate 0006703 resolveduser6 Segmentation fault on world load after retiring a saved fort 
has duplicate 0006652 resolveduser6 Unpausing after loading a save game causes crash 
has duplicate 0006746 resolveduser11 Game crashes whenever I load the save of my fortress 
has duplicate 0006824 resolveduser6 Crash on loading old save (child of 0006681?) 
has duplicate 0006825 resolveduser11 Game Crashes when selecting continue playing 
has duplicate 0006786 resolveduser11 Crashes loading fortress [Fortress Mode / World Info] 
has duplicate 0006809 resolveduser6 Crash on unpause after loading [Fortress Mode / c0000094 Divide By Zero] 
has duplicate 0006839 resolveduser11 Crash during load [Fortress Mode / Formations] 
has duplicate 0006790 resolveduser11 Crash loading save 
has duplicate 0006858 resolveduser11 crash while "loading civilized populations..." 
has duplicate 0006783 resolveduser11 Crash during load [Fortress Mode / Army Controllers] 
has duplicate 0006881 resolveduser6 crash after fortress load 
has duplicate 0006802 resolveduser6 Crash occurrs 10 seconds after loading save 
has duplicate 0006629 resolveduser11 Game crashes on Load world [Fortress Mode / History] 
has duplicate 0006760 resolveduser6 CTD -- After embark, crash within 3-5 seconds 
has duplicate 0006864 resolveduser6 Segfault after unpausing saved game in Dwarf Mode 
has duplicate 0006567 resolveduser11 Game crashes randomly during play, no identifiable trigger event 
has duplicate 0006633 resolveduser6 Floating point crash 
has duplicate 0006728 resolveduser6 Crash on reload of saved Fortress 
has duplicate 0006565 resolveduser6 Crash for unknown reason while game simply running in the background unattended 
has duplicate 0007271 resolveduser6 New fort crashes after retiring previous fort 
has duplicate 0006631 resolveduser6 Instant Crash on "unpause" in dwarf mode 
has duplicate 0006827 resolveduser11 This save crashes a few seconds after loading it 
has duplicate 0006572 resolveduser6 Crash on second time loading world 
has duplicate 0006617 resolveduser6 Immediate crash after loading and unpausing dwarf mode save 
related to 0006523 confirmeduser6 Crash after generating world and immediately reclaiming/unretiring a worldgen fortress 

Activities

user11

2014-07-08 12:18

  ~0025117

Various forms of crashes are appearing in reports for loading fortress mode saves, so I'm acknowledging this and placing the others as children for now.

zanzammar

2014-07-08 12:18

reporter   ~0025118

I am having the same issue. I created a fort and saved after some playtime. The game continuously crashed when loading the fort. I scrubbed the save and created a second fort then saved just after embark. The second save will also not load. This is a serious show-stopper bug.

The crash occurs when the loading screen has the "Loading world information" message on the loading bar.

Windows 7 spits out this error report on crash:
Problem Event Name: APPCRASH
  Application Name: Dwarf Fortress.exe
  Application Version: 0.0.0.0
  Application Timestamp: 53bb189a
  Fault Module Name: Dwarf Fortress.exe
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp: 53bb189a
  Exception Code: c0000005
  Exception Offset: 00455c47
  OS Version: 6.1.7601.2.1.0.256.1
  Locale ID: 1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789


I believe c0000005 code is an access violation?

And the save for the second fort, just after embark:
https://drive.google.com/file/d/0B6DAm30aqp9nZTBqbnk5UEVId1U/edit?usp=sharing

Jarathor

2014-07-08 17:16

reporter   ~0025186

I imagine you have enough to work on now, but since I already uploaded a save to DFFD with the exact same problem (crashes on "loading world information," exception code 0xc0000005, fault offset 0x00455c47), I might as well link it here. I hope it helps. http://dffd.wimbli.com/file.php?id=8767

killhour

2014-07-09 08:00

reporter   ~0025304

Last edited: 2014-07-09 08:38

Here's another save that crashes. This one doesn't crash immediately - takes a few seconds after unpause.

http://dffd.wimbli.com/file.php?id=8792

Edit:

Running DF through a debugger, it keeps faulting on a divide by 0 in the same place.

(2594.8d4): Integer divide-by-zero - code c0000094 (!!! second chance !!!)
eax=00000000 ebx=14549a90 ecx=00000000 edx=00000000 esi=00000000 edi=00000000
eip=01abe0cb esp=03fef350 ebp=00000000 iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246
Dwarf_Fortress+0x8de0cb:
01abe0cb f7f1 div eax,ecx

Changing register ecx to 1 instead of 0 allows the game to continue normally, but it gets reset to 0 a few seconds later, causing the same issue.

ronnideworm

2014-07-09 10:46

reporter   ~0025352

I've got a similar crash, the game crashes consistently right after the miners return from their drinking break (replicated it 5 times)

http://dffd.wimbli.com/file.php?id=8803

shoop

2014-07-09 11:53

reporter   ~0025360

I think I've been seeing the same thing with retired adventurers, not just retired fortresses.

ArmokGoB

2014-07-09 12:03

reporter   ~0025362

Haven't had that happen yet, shoop.

Toady One

2014-07-09 23:22

administrator   ~0025490

I've identified identical issues in three of the saves that would lead to trouble. The problem is getting the root cause to reproduce. Just starting a fort, retiring, and then starting a new game are not sufficient -- the potential problem data is fine. I wonder if the first fort has to be played for long enough for some trigger to corrupt the relevant data. I'm going to continue poking around.

newjrmint15

2014-07-10 00:52

reporter   ~0025494

i seem to be having the exact same issue, except it happens after an adventurer dies or is retired. the next time i start adventure mode it will crash on me.

thewonderidiot

2014-07-10 01:07

reporter   ~0025496

For reproducibility, it seems to me that the thing that causes crashing during save loading is when I manually save the game -- seasonal saves have been mostly fine for me. Moreover if I load a save and then immediately save again, I get a save that can no longer load probably 80% of the time. Here's a save that can be caused to bug out, but loads correctly: http://dffd.wimbli.com/file.php?id=8829

Toady One

2014-07-10 01:16

administrator   ~0025497

Yeah, that save has the same issue already. I'm not sure why the seasonal saves are any more stable, but all of the interactions are corrupted there. I'm not sure what's causing that to happen yet, of course.

Lemunde

2014-07-10 03:03

reporter   ~0025502

Last edited: 2014-07-10 03:05

After some testing I think I may have tracked the cause down to something to do with INITIAL_SAVE being set to YES on a new fort. Setting this to NO allows my to play past the first few minutes and saving without my world becoming corrupted. I suspect something similar happens with seasonal and yearly saves being active, which would explain why this has been happening to my forts so early on and a bit later for other people.

Somehow, autosaves appear to be corrupting data causing normal saves and potentially future autosaves to become corrupted. In the short term this could be handled simply by disabling autosaves, although I haven't done any further testing to ensure that this completely solves the problem.

user11

2014-07-10 06:22

  ~0025521

FYI, Lemunde's forum thread on player-testing of this bug is here:
http://www.bay12forums.com/smf/index.php?topic=140133.msg5457596#msg5457596

Jode

2014-07-10 08:24

reporter   ~0025537

Additionally, for me at least, in both of my worlds where I have this error it always crashes on "Loading tracking information".

thewonderidiot

2014-07-10 08:53

reporter   ~0025541

+1 to what Lemunde said. I haven't enabled INITIAL_SAVE, but manual saves being dead when made after an autosave has taken place during the same play session is completely consistent with all of my bad saves so far, I think. I'm guessing that the interactions save function is destructive (or something else alters them), such that any subsequent save without exiting the game will be corrupt.

Toady One

2014-07-10 09:23

administrator   ~0025546

Yeah, all auto-saves appear to be wiping the random object data, and the game isn't happy to continue playing and saving after that. Hopefully I'll be able to post a fix release today (have to code it first, and there's one non-trivial issue in doing that).

Issue History

Date Modified Username Field Change
2014-07-08 11:22 ArmokGoB New Issue
2014-07-08 12:12 user11 Relationship added parent of 0006687
2014-07-08 12:13 user11 Relationship added parent of 0006624
2014-07-08 12:18 user11 Note Added: 0025117
2014-07-08 12:18 user11 Assigned To => user11
2014-07-08 12:18 user11 Status new => acknowledged
2014-07-08 12:18 zanzammar Note Added: 0025118
2014-07-08 12:31 user11 Relationship added parent of 0006661
2014-07-08 12:44 user11 Relationship added parent of 0006609
2014-07-08 12:45 user11 Relationship added related to 0006523
2014-07-08 12:47 user11 Relationship added parent of 0006606
2014-07-08 13:03 user6 Relationship added has duplicate 0006703
2014-07-08 13:05 user11 Sticky Issue No => Yes
2014-07-08 17:04 user11 Relationship added parent of 0006738
2014-07-08 17:05 user11 Relationship added parent of 0006652
2014-07-08 17:16 Jarathor Note Added: 0025186
2014-07-08 18:14 user11 Relationship added parent of 0006746
2014-07-09 07:31 user6 Relationship added related to 0006824
2014-07-09 08:00 killhour Note Added: 0025304
2014-07-09 08:38 killhour Note Edited: 0025304
2014-07-09 09:17 user11 Relationship added has duplicate 0006825
2014-07-09 09:43 user11 Relationship added parent of 0006786
2014-07-09 09:45 user11 Relationship added parent of 0006809
2014-07-09 10:46 ronnideworm Note Added: 0025352
2014-07-09 11:53 shoop Note Added: 0025360
2014-07-09 12:03 ArmokGoB Note Added: 0025362
2014-07-09 14:36 user11 Relationship added parent of 0006839
2014-07-09 14:41 user11 Relationship added parent of 0006790
2014-07-09 14:57 user11 Relationship added parent of 0006858
2014-07-09 15:04 user11 Relationship added related to 0006843
2014-07-09 15:13 user11 Relationship added parent of 0006783
2014-07-09 15:21 user6 Relationship added related to 0006881
2014-07-09 15:21 user6 Relationship added related to 0006802
2014-07-09 15:28 user11 Relationship added parent of 0006629
2014-07-09 17:07 user6 Relationship added related to 0006760
2014-07-09 19:44 user6 Relationship added related to 0006900
2014-07-09 23:22 Toady One Note Added: 0025490
2014-07-10 00:52 newjrmint15 Note Added: 0025494
2014-07-10 01:07 thewonderidiot Note Added: 0025496
2014-07-10 01:16 Toady One Note Added: 0025497
2014-07-10 03:03 Lemunde Note Added: 0025502
2014-07-10 03:05 Lemunde Note Edited: 0025502
2014-07-10 06:22 user11 Note Added: 0025521
2014-07-10 08:24 Jode Note Added: 0025537
2014-07-10 08:53 thewonderidiot Note Added: 0025541
2014-07-10 09:23 Toady One Note Added: 0025546
2014-07-10 09:23 Toady One Status acknowledged => resolved
2014-07-10 09:23 Toady One Fixed in Version => Next Version
2014-07-10 09:23 Toady One Resolution open => fixed
2014-07-10 09:23 Toady One Assigned To user11 => Toady One
2014-07-10 09:30 user6 Relationship added has duplicate 0006864
2014-07-11 00:45 user11 Relationship added parent of 0006567
2014-07-11 10:45 user6 Relationship replaced has duplicate 0006760
2014-07-11 10:45 user6 Relationship deleted related to 0006843
2014-07-11 10:46 user6 Relationship replaced has duplicate 0006881
2014-07-11 10:46 user6 Relationship replaced has duplicate 0006809
2014-07-11 10:46 user6 Relationship replaced has duplicate 0006746
2014-07-11 10:47 user6 Relationship replaced has duplicate 0006839
2014-07-11 10:48 user6 Relationship replaced has duplicate 0006802
2014-07-11 10:51 user6 Relationship replaced has duplicate 0006567
2014-07-11 10:52 user6 Relationship replaced has duplicate 0006609
2014-07-11 10:53 user6 Relationship replaced has duplicate 0006786
2014-07-12 08:35 user6 Summary Game crash after loading game with player fort in it => Game crash after loading game with player fort in it (save corruption)
2014-07-12 10:47 user6 Relationship added has duplicate 0006633
2014-07-12 12:17 user6 Relationship replaced has duplicate 0006606
2014-07-12 12:17 user6 Relationship replaced has duplicate 0006858
2014-07-12 12:21 user6 Relationship replaced has duplicate 0006629
2014-07-12 12:22 user6 Relationship deleted related to 0006900
2014-07-12 12:22 user6 Relationship deleted parent of 0006738
2014-07-12 12:23 user6 Relationship replaced has duplicate 0006824
2014-07-12 12:24 user6 Relationship replaced has duplicate 0006783
2014-07-12 12:25 user6 Summary Game crash after loading game with player fort in it (save corruption) => Autosave causes save corruption and crashes on load
2014-07-12 12:26 user6 Relationship added has duplicate 0006728
2014-07-12 12:26 user6 Relationship replaced has duplicate 0006624
2014-07-12 12:26 user6 Relationship replaced has duplicate 0006687
2014-07-12 12:27 user6 Relationship replaced has duplicate 0006661
2014-07-12 12:27 user6 Relationship replaced has duplicate 0006790
2014-07-12 12:28 user6 Relationship replaced has duplicate 0006652
2014-07-14 11:04 user6 Relationship added has duplicate 0006565
2014-07-14 11:05 user6 Relationship added has duplicate 0007271
2014-07-14 11:25 user6 Relationship added has duplicate 0006631
2014-07-14 11:28 user6 Relationship added has duplicate 0006827
2014-07-14 11:30 user6 Relationship added has duplicate 0006572
2014-07-16 07:20 user6 Relationship added has duplicate 0006617
2014-07-18 13:02 user11 Sticky Issue Yes => No