Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001777Dwarf FortressTechnical -- Generalpublic2010-05-05 22:172017-05-17 14:21
ReporterThe Architect 
Assigned To 
PriorityhighSeverityblockReproducibilityhave not tried
StatusnewResolutionopen 
PlatformOSVistaOS Version
Product Version0.31.03 
Target VersionFixed in Version 
Summary0001777: Multiple instances of DF can run simultaneously in same folder, resulting in save corruption
DescriptionSaving simultaneously in duplicate DF applications causes corruption in one or more.

"One of the compressed files on disk has errors on it. Restore from backup if you are able."
Steps To ReproduceBack up your data/save folder.
Open DF twice from the same copy, open two separate forts. Save both simultaneously. If the program manages to complete both saves, attempt to open the files.
TagsNo tags attached.
Attached Files

- Relationships
has duplicate 0002641resolvedFootkerchief Multiple instances of the game can be opened 
has duplicate 0005518resolvedKnight Otu Simultaneously using legends mode and adventure mode might lead to save file problems 

-  Notes
(0006241)
Footkerchief (manager)
2010-05-05 22:25
edited on: 2010-05-05 22:27

Most likely because they're sharing the "current" folder. That was probably the motivation for this old bug entry:

# 000020 □ [technical] (http://www.bay12forums.com/smf/index.php?topic=21812.0 [^]) stop multiple copies of the program from being open

(0009985)
shibdib (reporter)
2010-07-11 17:17

confirmed still in 0.31.10
(0020942)
zombiejustice (reporter)
2012-03-01 06:04

This doesn't seem like high priority: you're doing something OUTSIDE the game, that you know will break the game. Should this be closed as 'working as intended'?
(0020943)
Footkerchief (manager)
2012-03-01 07:08

As I mentioned in the first note, this was in the old bug list that Toady used to maintain (dev_bugs.html).
(0020947)
thvaz (reporter)
2012-03-01 09:00

If he never got around to fix it, maybe he doesn't know how? He may need some help then.

I have little experience as a programmer, but this doesn't sound like something that would demand a lot of time.
(0020948)
Xotano (reporter)
2012-03-01 09:02

well you would think people would refrain from opening multiple game windows.
(0023994)
Brilliand (reporter)
2013-06-06 15:11

Multiple instances of DF being able to load the same save is a good thing. However, it should probably balk at overwriting a save that doesn't match the one it loaded (say, store a version number somewhere). If that happens, it could maybe offer to save in a different folder.

That's getting pretty far away from the "permanent death" ideal, but I don't like permanent death anyway. :p
(0036522)
alexchandel (reporter)
2017-05-11 13:16

I recently had to run two DF instances at once, so I'm glad it's possible.

Assuming you don't attempt to save, and kill both processes with killall/SIGTERM, is there any possible way DF can corrupt any of its files?

As far as behavior, the only change that could be added is: locking on a lock-file in the region folder when saving, so that another process doesn't try to simultaneously save and corrupt the files.
(0036537)
lethosor (manager)
2017-05-17 14:21

If you don't save, as far as I know, the only files that will be touched are those in data/save/current, which is cleared periodically.

However, I would still recommend not doing what you did, because DF could be confused if it tries to read files from data/save/current and gets files from another save, or if it fails to read files that the other DF process deleted already.

As for your locking suggestion, that wouldn't prevent corruption, because if data/save/current contains files from two different saves, they'll still be copied into the wrong region folder(s).

- Issue History
Date Modified Username Field Change
2010-05-05 22:17 The Architect New Issue
2010-05-05 22:25 Footkerchief Note Added: 0006241
2010-05-05 22:27 Footkerchief Note Edited: 0006241 View Revisions
2010-06-29 07:38 Footkerchief Category Technical => Technical -- General
2010-07-11 16:50 Footkerchief Relationship added has duplicate 0002641
2010-07-11 16:50 Footkerchief Summary Saving simultaneously with two DF programs causes file corruption => Multiple instances of DF can run simultaneously in same folder, resulting in save corruption
2010-07-11 17:17 shibdib Note Added: 0009985
2012-03-01 02:14 Knight Otu Relationship added has duplicate 0005518
2012-03-01 06:04 zombiejustice Note Added: 0020942
2012-03-01 07:08 Footkerchief Note Added: 0020943
2012-03-01 09:00 thvaz Note Added: 0020947
2012-03-01 09:02 Xotano Note Added: 0020948
2012-09-20 08:04 Footkerchief Relationship added has duplicate 0006204
2013-06-06 15:11 Brilliand Note Added: 0023994
2014-01-20 19:06 Footkerchief Relationship deleted has duplicate 0006204
2017-05-11 13:16 alexchandel Note Added: 0036522
2017-05-17 14:21 lethosor Note Added: 0036537


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker