Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0001828Dwarf FortressGeneralpublic2010-05-10 14:152010-06-09 07:56
superradish 
Toady One 
normalcrashalways
resolvedfixed 
0.31.03 
0.31.06 
0001828: Crash when doctor cleans patient with almost-depleted bar of soap (size goes negative?)
Edit: Deactivating the hospital zone and removing beds has some effect on the crash. See the notes for superradish's reports.

This save is unstable. It's crashing based on an event like the month changing, the elves leaving, a new mayor getting elected, or some such. Submitting it in case it's a new bug: http://dffd.wimbli.com/file.php?id=2325 [^]
load the game, unpause it. Wait.
suturer
parent of 0001264resolved Toady One Hospital causes game crash (save included) 
parent of 0002133resolved Toady One Mysteriously crashes. 
parent of 0002054resolved Toady One random crash - error.log 
parent of 0001917resolved Toady One Repeatable 31.04/31.03 crash on load - hospital related 
parent of 0000839resolved Toady One Crash when cleaning patient 
parent of 0001398resolved Toady One 100% repeatable crash in fortress mode - hospital related 
Issue History
2010-05-10 14:15superradishNew Issue
2010-05-10 16:54Logical2uNote Added: 0006521
2010-05-10 18:33superradishNote Added: 0006526
2010-05-10 18:56superradishNote Added: 0006528
2010-05-10 19:03superradishNote Added: 0006530
2010-05-10 19:04superradishTag Attached: suturer
2010-05-10 19:08Logical2uNote Added: 0006532
2010-05-10 19:13Logical2uNote Edited: 0006532bug_revision_view_page.php?bugnote_id=0006532#r2415
2010-05-10 19:25Logical2uSummarycrashing within moments of loading game => crashing within moments of loading game - hospital related - save included
2010-05-10 19:25Logical2uDescription Updatedbug_revision_view_page.php?rev_id=2419#r2419
2010-05-11 07:52superradishNote Added: 0006546
2010-05-11 07:53superradishNote Edited: 0006530bug_revision_view_page.php?bugnote_id=0006530#r2428
2010-05-11 10:20superradishNote Added: 0006548
2010-05-16 08:49Logical2uRelationship addedrelated to 0001264
2010-06-03 09:58zerglNote Added: 0007612
2010-06-03 09:58zerglIssue Monitored: zergl
2010-06-03 10:09zerglNote Edited: 0007612bug_revision_view_page.php?bugnote_id=0007612#r2827
2010-06-03 11:26FootkerchiefRelationship addedparent of 0002133
2010-06-03 11:26FootkerchiefRelationship addedparent of 0002054
2010-06-03 11:26FootkerchiefRelationship addedparent of 0001917
2010-06-03 11:28FootkerchiefNote Added: 0007616
2010-06-03 11:29FootkerchiefSummarycrashing within moments of loading game - hospital related - save included => Crash when dwarves try to use particular bar of soap - save included
2010-06-03 11:35zerglNote Added: 0007618
2010-06-03 11:42DwarfuIssue Monitored: Dwarfu
2010-06-03 11:49FootkerchiefSticky IssueNo => Yes
2010-06-03 11:50FootkerchiefNote Added: 0007619
2010-06-03 12:10FootkerchiefRelationship addedrelated to 0000839
2010-06-03 12:26FootkerchiefRelationship replacedparent of 0001264
2010-06-03 12:26FootkerchiefRelationship addedrelated to 0001398
2010-06-03 12:27zerglNote Added: 0007628
2010-06-03 12:31FootkerchiefNote Added: 0007629
2010-06-03 12:33FootkerchiefSummaryCrash when dwarves try to use particular bar of soap - save included => Crash when dwarves use an almost-depleted bar of soap (size goes negative?)
2010-06-03 12:36zerglNote Added: 0007631
2010-06-03 12:42FootkerchiefRelationship replacedparent of 0001398
2010-06-03 13:07FootkerchiefRelationship replacedparent of 0000839
2010-06-03 13:08FootkerchiefSummaryCrash when dwarves use an almost-depleted bar of soap (size goes negative?) => Crash when dwarves use clean patient almost-depleted bar of soap (size goes negative?)
2010-06-03 13:08FootkerchiefSummaryCrash when dwarves use clean patient almost-depleted bar of soap (size goes negative?) => Crash when doctor cleans patient with almost-depleted bar of soap (size goes negative?)
2010-06-06 02:15Toady OneNote Added: 0007776
2010-06-06 02:15Toady OneStatusnew => resolved
2010-06-06 02:15Toady OneFixed in Version => 0.31.06
2010-06-06 02:15Toady OneResolutionopen => fixed
2010-06-06 02:15Toady OneAssigned To => Toady One
2010-06-06 07:34DwarfuIssue End Monitor: Dwarfu
2010-06-06 09:37FootkerchiefSticky IssueYes => No
2010-06-09 06:45Toady OneStatusresolved => closed
2010-06-09 07:56FootkerchiefStatusclosed => resolved

Notes
(0006521)
Logical2u   
2010-05-10 16:54   
I successfully had a mayor elected once while investigating this crash, but I wasn't able to resolve the crash by removing jobs, nobles, or the military.
(0006526)
superradish   
2010-05-10 18:33   
removing the hospital and the one burrow seems to have fixed the issue, i'll try just the burrow
(0006528)
superradish   
2010-05-10 18:56   
it's definitely the hospital - i'm currently narrowing down which hospital related thing is causing the problem.. i think it's the miner ber
(0006530)
superradish   
2010-05-10 19:03   
(edited on: 2010-05-11 07:53)
found it - removing the hospital zone and individually treating the patients took care of it. I also made sure only one dwarf had the suture job set, i believe it's the suture job itself that was causing the crash. Things are running well now and it appears that i can continue this fort.

(0006532)
Logical2u   
2010-05-10 19:08   
(edited on: 2010-05-10 19:13)
Good catch radish. Deactivating the hospital zone temporarily stops the crash - I decided to remove some of the buildings in the hospital to see if that would save it, but it crashed after the removal of the top most traction bench and cabinet, and during the removal of the middle cabinet and one of the middle traction benches.

Edit: Well, deconstructing the beds underneath the patients and deactivating the hospital zone seems to fix the crash, so it's likely there's a crash-causing surgery job somewhere.

(0006546)
superradish   
2010-05-11 07:52   
funny thing is, i got hit by anything siege later and now the hospital is even more occupied - getting crashes again.. i have to shut the hospital off and do the jobs one at a time to prevent the crash
(0006548)
superradish   
2010-05-11 10:20   
to add more to the issue, sometimes a hospital bed gets bugged.. no surgeries or diagnoses will be performed until you remove the bed so the patient gets moved, then it'll work as normal. Also, after a patient is healed, you have to remove the bed to get them to get up and leave. (at least in the cases i've encountered with this game)
(0007612)
zergl   
2010-06-03 09:58   
(edited on: 2010-06-03 10:09)
I was having a look at this crash after playing around with other healthcare related crashes.

Forbidding all items in the hospital's containers appears to prevent this crash as well (running for well past five minutes at 30-40 FPS now without crashing). I will try to narrow down which item exactly causes the bug. My bet is on a certain bar of soap or piece of thread.


edit: OK, looks like forbidding the bottom bar of soap in the top hospital zone coffer apparently prevents or at least postpones the crash (already running for several minutes again).
This could imply that this crash is related to http://www.bay12games.com/dwarves/mantisbt/view.php?id=2054 [^]

My personal crackpot guesstimating theory is that using a particular bar of soap which is almost used up sends its remaining "size" to a negative value leading to the crash.

(0007616)
Footkerchief   
2010-06-03 11:28   
Okay, I'm consolidating the confirmed soap crashes under this report. The unconfirmed-but-suspicious ones are 0001264 and 0001398.
(0007618)
zergl   
2010-06-03 11:35   
I'm on to try and confirm these two, if you like.


Also, the uploaded save by Se5a in the notes for report 0001917 looks like another instance of the soap crash. Currently trying to get a save within a few frames of the crash to get a better testing environment, but I saw a doctor with a clean wound job suspiciously approach and start the job on a patient when it happened.
(0007619)
Footkerchief   
2010-06-03 11:50   
I'm on to try and confirm these two, if you like.

That would be excellent.

And yeah, I saw your note on 0001917 and made that report a child of this one.
(0007628)
zergl   
2010-06-03 12:27   
Confirmed the first one and it seems to point towards my suspicion/theory of almost used up bars being too "small" and going negative.

The bar of forgotten beast soap in that instance is worth 42 units of soap in the hospital inventory screen. Forbidding it leads to the doc using a bar of cow soap instead of which around 50 units are used up (and no crash). I find this behavior too suspicious to be a coincidence, to be honest.
(0007629)
Footkerchief   
2010-06-03 12:31   
Yeah, that's some compelling evidence. I'll put that theory in the summary.
(0007631)
zergl   
2010-06-03 12:36   
Just confirmed the second one too, and again, the bar causing the crash contained only 42 "soap-units" left.

Currently going at the save uploaded by Kumquat in the notes of the second report.
(0007776)
Toady One   
2010-06-06 02:15   
Yeah, it was the small bars -- when they became spent, it tried to use the dead pointer to record the exact soap material for the hospital log. It is fixed now for 0.31.06. Thanks to zergl for all the testing! That was very helpful.