Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0005937Dwarf FortressDwarf Mode -- Jobs, Haulingpublic2012-05-21 22:062012-05-27 18:19
MinsEcho 
Toady One 
normalcrashhave not tried
resolvedfixed 
0.34.09 
0.34.11 
0005937: Hauler with bin wanders in circles
One of my dwarves was walking in a small circle with a bin full of armor bound for a stockpile, and regardless of what I did he would not stop. He ignored squad assignments, removal of hauling from his jobs, and when I forbid the bin the game crashed. Looking at the error log does not show anything obvious.
I'm going to try and reproduce this tomorrow, see if it has something to do with bins in general and whether dropping a cave in on the dwarf can fix it.
Save Included
related to 0000596resolved Toady One Humans' Diplomat is a demon, destroys all constructions it passes by, never initiates meeting 
has duplicate 0006054resolved Footkerchief Dwarf in pathfinding loop 
related to 0005948resolved Toady One Detaching container from a Store In Bin/Barrel job causes crash in combining code. 
related to 0005997new  Dwarves, pathfinding issue when eating? Walking constantly back and forth in a "V' shape. 
Issue History
2012-05-21 22:06MinsEchoNew Issue
2012-05-22 07:06FootkerchiefNote Added: 0022659
2012-05-22 07:06FootkerchiefTag Attached: AWAITING UPDATE
2012-05-22 13:53MinsEchoNote Added: 0022671
2012-05-22 13:53MinsEchoNote Edited: 0022671bug_revision_view_page.php?bugnote_id=0022671#r8436
2012-05-22 15:04FootkerchiefTag Detached: AWAITING UPDATE
2012-05-22 21:41SirPenguinNote Added: 0022684
2012-05-23 15:48vidboiNote Added: 0022692
2012-05-23 16:05vidboiNote Edited: 0022692bug_revision_view_page.php?bugnote_id=0022692#r8445
2012-05-23 18:05SirPenguinTag Attached: Save Included
2012-05-24 12:00FootkerchiefRelationship addedhas duplicate 0005948
2012-05-24 12:01FootkerchiefSummaryHauler with bin wanders in circles, gamecrash if interfered with => Crash when container is detached from "Store in Bin/Barrel" job
2012-05-24 12:02FootkerchiefIssue Monitored: Toady One
2012-05-24 12:03FootkerchiefNote Added: 0022707
2012-05-24 12:31agNote Added: 0022710
2012-05-24 13:21FootkerchiefNote Added: 0022711
2012-05-24 13:43agNote Added: 0022712
2012-05-24 14:47FootkerchiefSummaryCrash when container is detached from "Store in Bin/Barrel" job => Hauler with bin wanders in circles
2012-05-24 15:11FootkerchiefRelationship replacedrelated to 0005948
2012-05-27 08:58agNote Added: 0022744
2012-05-27 09:01QuietustNote Added: 0022745
2012-05-27 11:48FootkerchiefRelationship addedrelated to 0000596
2012-05-27 18:19Toady OneStatusnew => resolved
2012-05-27 18:19Toady OneFixed in Version => Next Version
2012-05-27 18:19Toady OneResolutionopen => fixed
2012-05-27 18:19Toady OneAssigned To => Toady One
2012-06-10 13:41FootkerchiefRelationship addedrelated to 0005997
2014-12-30 20:24FootkerchiefRelationship addedhas duplicate 0006054

Notes
(0022659)
Footkerchief   
2012-05-22 07:06   
Reminder sent to: MinsEcho

Please upload a save demonstrating this problem to http://dffd.wimbli.com/ [^] and post the link here.
(0022671)
MinsEcho   
2012-05-22 13:53   
I was just able to reproduce this. F2 zooms to the guilty hauler. Careful of the strange mood dwarf nearby, he's about to go insane and is carrying a battleaxe. Actually, the first just stopped, but someone else is doing the same thing just to the north.
http://dffd.wimbli.com/file.php?id=6366 [^]

(0022684)
SirPenguin   
2012-05-22 21:41   
I have the same issue. My guy is in a narrow hallway pacing back and forth carrying a barrel with "Store Item in Barrel" job.

The barrel has a bunch of plump helmets in it. I think he harvested them from the farm.

Designating the area around him to be dug out caused him to move a bit further...then he repeated his little dance. After a few repeats of this he eventually freed himself.

Save: http://dffd.wimbli.com/file.php?id=6371 [^]
(0022692)
vidboi   
2012-05-23 15:48   
(edited on: 2012-05-23 16:05)
Had the same issue, and I believe that I've found the cause and a temporary solution before it's fixed. It seems to occur with bins and barrels assigned to stockpiles (those with numbers). If the stockpile gets filled whilst the bin is being moved it can't be placed back there and the dwarf wanders in circles. Creating a new stockpile for the item doesn't work either, but dumping what's in the existing stockpile to make way for it seems to resolve the issue. I'm not certain on this; although the bin was eventually moved to the stockpile it was not by the same dwarf who was walking in circles with it (they got thirsty and dropped it to get a drink). If anyone else could test this to see if it works i'd be grateful.

update: Appears that it doesn't work. I got another dwarf doing the same thing with the same stockpile but making space in the stockpile didn't stop it. After stopping due to thrist another dwarf promply picked it up and took it to it's destination successfully, just as before. The next test is to see if deleting the stockpile the bin is assigned to has any effect.

(0022707)
Footkerchief   
2012-05-24 12:03   
ag posted details at 0005948.
(0022710)
ag   
2012-05-24 12:31   
This bug is not about the crash, it is about dwarves 'walking in a small circle'; therefore renaming it is incorrect.
(0022711)
Footkerchief   
2012-05-24 13:21   
This report was about both the circle-walking and the subsequent crash. Do you have reason to believe that they're separate problems?
(0022712)
ag   
2012-05-24 13:43   
I can see no way a failure to check a pointer for NULL can cause circle-walking, since in the only situation when that check would make a difference, omitting it leads to an immediate crash. The crash is caused by forbidding the bin (or otherwise causing the item to be removed from the job), whether there is any circle-walking going on, or not. Of course, I don't have the source code, only the stack backtrace and disassembly to base my opinion on.
(0022744)
ag   
2012-05-27 08:58   
Felt like investigating the actual running around behavior. It seems what happens is this:

Hauling code re-evaluates which item is closest to get every N frames, instead of once for every item; this means that if actually getting to it requires temporarily moving away due to obstacles in the way, a different item can be chosen as target at that point. If trying to get to it in turn causes the unit to move back to where it started, the loop repeats.
(0022745)
Quietust   
2012-05-27 09:01   
This behavior reminds me of 0000596, an old bug from 0.31.12 and earlier, where [BUILDINGDESTROYER:2] diplomats could get stuck "dancing" in circles for what was probably the exact same reason.