Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0008719Dwarf FortressDwarf Mode -- Jobs, Constructions (walls etc)public2015-01-10 10:372015-12-27 13:38
Toady One 
0008719: Building constructions over parts of trees crashes
Prior to DF 0.40.24 building a construction on a tree would cause the tree to vanish. In the current version it now causes a game crash.
Build a construction on part of a tree
http://dffd.wimbli.com/file.php?id=10414 [^] (0.40.24)
http://dffd.wimbli.com/file.php?id=10457 [^] (0.40.24, from 0008746)
http://dungeonofdata.tk/crashing_save.txz [^] (0.40.24, from 0008763)
https://www.dropbox.com/s/07ku4v40m7ff5as/region3.zip?dl=0 [^] (0.40.24, from 0008973)
http://dffd.bay12games.com/file.php?id=11006 [^] (0.40.24, from 0009028)
http://dffd.bay12games.com/file.php?id=11138 [^] (0.40.24, from 0009070)
http://dffd.bay12games.com/file.php?id=11225 [^] (0.40.24, from 0009104)

Illustration from 0009122: http://i.imgur.com/KSRPH8j.png [^]
binary patch
has duplicate 0008723resolved Footkerchief Unknown Fortress Mode Crash 
has duplicate 0008746resolved lethosor Attempt to construct on a tile where a tree has grown causes crash 
has duplicate 0008763resolved Footkerchief Game crashes a few seconds after unpausing this save 
has duplicate 0008783resolved lethosor Constructing walls in an block occupied by leaves crashes the game 
has duplicate 0008791resolved lethosor Floor On Tree Branch Crashes Game 
has duplicate 0008803resolved lethosor Dwarf Mode Crash 
has duplicate 0008810resolved lethosor Crashes half a minute in. 
has duplicate 0008821resolved Dwarfu Elven caravan arrival crashes the game (probably) 
has duplicate 0008832resolved Dwarfu Core dump 
has duplicate 0008835resolved Dwarfu Game crashes within one minute after reloading a saved fortress 
has duplicate 0008854resolved Dwarfu Crashes a few ticks into Early Winter 
has duplicate 0008875resolved Knight Otu Building Floor on Mushroom 
has duplicate 0008872resolved Footkerchief Crash after traders leave map? 
has duplicate 0008740resolved Footkerchief Fort Mode crashes in early Autumn of the first year. 
has duplicate 0008884resolved Dwarfu Game crashes with no particular reason 
has duplicate 0008919resolved Knight Otu Game crashes when trying to build a staircase in caverns on top of a tree 
has duplicate 0008920resolved Knight Otu Semi-random crashes 
has duplicate 0008921resolved Knight Otu Game crash on Wall construction on tree wigs 
has duplicate 0008948resolved lethosor Consistent crash within minute of load, unknown reason. 
has duplicate 0008973resolved lethosor Data Execution Prevention crash to desktop 
has duplicate 0008981resolved Knight Otu Crash when floor is built in square that has branches. 
has duplicate 0009028resolved lethosor Game crashes when building floor tiles over twigs 
has duplicate 0009070resolved lethosor Dwarves attempt to build wall through tree branches, hilarity ensues 
has duplicate 0009104resolved lethosor Game Crash for Unknown Reason 
has duplicate 0009119resolved Knight Otu Program crashes a few seconds after unpausing loaded save 
has duplicate 0009122resolved lethosor Don't build walls in a tree's leaves - Game will crash if dwarf climbs tree 
has duplicate 0009687resolved Knight Otu Crash on building floor. 
has duplicate 0008934resolved Loci Game spontenously crashed during fortress mode 
related to 0006530confirmed Footkerchief Dwarves won't build stairs in trees (specifically leaves/twigs) 
related to 0006551resolved lethosor Constructing on trees causes them to vanish 
Issue History
2015-01-10 10:37ptb_ptbNew Issue
2015-01-10 10:45ptb_ptbNote Added: 0031852
2015-01-11 19:20FootkerchiefRelationship addedhas duplicate 0008723
2015-01-11 19:21FootkerchiefAssigned To => Footkerchief
2015-01-11 19:21FootkerchiefStatusnew => confirmed
2015-01-15 07:04FootkerchiefRelationship addedrelated to 0006530
2015-01-17 05:13lethosorRelationship addedhas duplicate 0008746
2015-01-17 05:15lethosorSummaryBuilding a floor over an underground tree ramp causes crash => Building floors over parts of trees crashes
2015-01-17 05:15lethosorAdditional Information Updatedbug_revision_view_page.php?rev_id=12808#r12808
2015-01-17 05:17lethosorAdditional Information Updatedbug_revision_view_page.php?rev_id=12809#r12809
2015-01-24 08:00txtsdIssue Monitored: txtsd
2015-01-24 14:41FootkerchiefRelationship addedhas duplicate 0008763
2015-01-24 15:23lethosorAdditional Information Updatedbug_revision_view_page.php?rev_id=12843#r12843
2015-02-02 20:14lethosorRelationship addedrelated to 0008783
2015-02-02 20:15lethosorRelationship replacedhas duplicate 0008783
2015-02-02 20:16lethosorIssue Monitored: RainbowTrout
2015-02-02 20:16lethosorSummaryBuilding floors over parts of trees crashes => Building constructions over parts of trees crashes
2015-02-05 08:40MenethIssue Monitored: Meneth
2015-02-05 11:01se5aNote Added: 0032151
2015-02-05 11:02se5aNote Edited: 0032151bug_revision_view_page.php?bugnote_id=0032151#r12887
2015-02-05 15:07RedDwarfStepperIssue Monitored: RedDwarfStepper
2015-02-05 18:10lethosorRelationship addedhas duplicate 0008791
2015-02-09 00:19ptb_ptbNote Added: 0032190
2015-02-09 12:53lethosorRelationship addedhas duplicate 0008803
2015-02-09 18:47lethosorRelationship addedhas duplicate 0008810
2015-02-11 18:14lethosorSticky IssueNo => Yes
2015-02-11 18:15lethosorSeverityminor => crash
2015-02-16 08:37ManaeNote Added: 0032230
2015-02-16 08:49lethosorNote Added: 0032231
2015-02-16 08:51lethosorDescription Updatedbug_revision_view_page.php?rev_id=12922#r12922
2015-02-16 08:51lethosorSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12924#r12924
2015-02-16 08:51lethosorNote Edited: 0032231bug_revision_view_page.php?bugnote_id=0032231#r12926
2015-02-16 08:51lethosorNote Edited: 0032231bug_revision_view_page.php?bugnote_id=0032231#r12927
2015-02-20 11:04DwarfuRelationship addedhas duplicate 0008821
2015-02-23 01:52DwarfuRelationship addedhas duplicate 0008832
2015-02-27 03:02DwarfuRelationship addedhas duplicate 0008835
2015-03-12 21:42DwarfuRelationship addedhas duplicate 0008854
2015-03-12 21:42DwarfuIssue Monitored: zerothe3rd
2015-03-26 07:40Afghani84Issue Monitored: Afghani84
2015-03-26 13:14Knight OtuRelationship addedhas duplicate 0008875
2015-03-29 07:54FootkerchiefRelationship addedhas duplicate 0008872
2015-03-29 08:17FootkerchiefRelationship addedhas duplicate 0008740
2015-03-29 18:04DwarfuRelationship addedhas duplicate 0008884
2015-04-19 12:17Knight OtuRelationship addedhas duplicate 0008919
2015-04-19 13:01Knight OtuRelationship addedhas duplicate 0008920
2015-04-19 14:16Knight OtuRelationship addedhas duplicate 0008921
2015-05-05 12:43clanlIssue Monitored: clanl
2015-05-06 14:22lethosorRelationship addedhas duplicate 0008948
2015-05-25 07:30QroxNote Added: 0032730
2015-05-25 07:41QroxNote Edited: 0032730bug_revision_view_page.php?bugnote_id=0032730#r13092
2015-05-25 07:51QroxNote Edited: 0032730bug_revision_view_page.php?bugnote_id=0032730#r13093
2015-05-25 14:03lethosorRelationship addedhas duplicate 0008973
2015-05-25 14:03lethosorIssue Monitored: dragoon508
2015-05-25 14:04lethosorAdditional Information Updatedbug_revision_view_page.php?rev_id=13094#r13094
2015-05-25 18:35QroxNote Edited: 0032730bug_revision_view_page.php?bugnote_id=0032730#r13097
2015-05-31 01:14Knight OtuRelationship addedhas duplicate 0008981
2015-06-14 09:35lethosorRelationship addedrelated to 0006551
2015-06-18 12:21max5212Issue Monitored: max5212
2015-06-18 12:21max5212Issue End Monitor: max5212
2015-06-19 08:48lethosorTag Attached: binary patch
2015-06-19 10:54lethosorNote Edited: 0032730bug_revision_view_page.php?bugnote_id=0032730#r13122
2015-06-19 12:38krenshalaIssue Monitored: krenshala
2015-07-25 17:18lethosorRelationship addedhas duplicate 0009028
2015-07-25 17:18lethosorAdditional Information Updatedbug_revision_view_page.php?rev_id=13232#r13232
2015-08-23 06:26mskalaNote Added: 0032990
2015-09-16 13:59lethosorRelationship addedhas duplicate 0009070
2015-09-16 14:00lethosorAdditional Information Updatedbug_revision_view_page.php?rev_id=13302#r13302
2015-10-26 14:10lethosorRelationship addedhas duplicate 0009104
2015-10-26 14:10lethosorAdditional Information Updatedbug_revision_view_page.php?rev_id=13357#r13357
2015-11-27 02:02Knight OtuRelationship addedhas duplicate 0009119
2015-11-28 07:23lethosorRelationship addedhas duplicate 0009122
2015-11-28 07:24lethosorAdditional Information Updatedbug_revision_view_page.php?rev_id=13375#r13375
2015-12-02 15:39Toady OneStatusconfirmed => resolved
2015-12-02 15:39Toady OneFixed in Version => Next Version
2015-12-02 15:39Toady OneResolutionopen => fixed
2015-12-02 15:39Toady OneAssigned ToFootkerchief => Toady One
2015-12-13 05:10clanlIssue End Monitor: clanl
2015-12-27 13:38DwarfuSticky IssueYes => No
2016-01-03 06:11Afghani84Issue End Monitor: Afghani84
2016-04-10 02:45Knight OtuRelationship addedhas duplicate 0009687
2016-08-08 18:15krenshalaIssue End Monitor: krenshala
2016-12-06 16:05LociRelationship addedhas duplicate 0008934

2015-01-10 10:45   
Save file: http://dffd.wimbli.com/file.php?id=10414 [^]
2015-02-05 11:01   
(edited on: 2015-02-05 11:02)
can we up the severity on this? it's happening really frequently for me, remembering to ensure spots I'm trying to construct on don't have leaves, twigs etc growing on them is not easy.

also the description needs to be changed on this, it's not just underground trees.

2015-02-09 00:19   
Just a note that if you _want_ fungus trees to vanish, you can use this bug 0008799
2015-02-16 08:37   
To add to this bug, since the related bugs are considered duplicates:

There is also a crash if you attempt to build over tree parts above ground. I attempted to build some stone floor on a tile currently occupied by twigs, and it crashes the game. Testing proves that it is the act of building on the tile itself, and not due to eager dwarves crossing tree branches to build on that tile early which would force the tree to support the construction.
2015-02-16 08:49   
(edited on: 2015-02-16 08:51)
se5a: The "severity" field is not used to prioritize issues at all - I only changed it to reflect the fact that this bug causes a crash.
Manae: Going by the title of this report, that is the same issue (although the description doesn't accurately reflect this).

Edit: updated description.

2015-05-25 07:30   
(edited on: 2015-06-19 10:54)
I just did some quick look into the game binary and have (probably) found the cause of the bug and a way to fix it. In Windows DF SDL 40.24, at dwarf fortress.exe+8F7174, inside a loop which seems to be intended to extirpate the tree, a function which is likely to be destroying all buildings built on the tree also deletes pending construction designations (which is a "building", in terms of game data structure). This also deletes the construction being finished and results in a hanging reference to it, and when the game later calls a virtual function of the structure, the vtable pointer has already been overwritten, causing a failed function call, which causes a segmentation fault. (Yeah, the good old delete object at a wrong time -> hanging reference thing).

A fix for this would be that just ignore any construction designation on the tree when destroying buildings on the tree.

A better fix for this would be not destroying the whole tree, but rather changing the construction designation into construction, and then remove the tile from the tree's structural data. This way you don't even need to destruct any buildings on the tree since the only tile changed is the tile of the construction, plus a possible down slope if the tile was an up slope, a down slope if the construction is an up slope, a floor if the construction is a wall, and down slopes don't support any sort of buildings, and a new down slope or floor will not cause a building to collapse.

A binary fix for Windows SDL 0.40.24 is available. Just change Dwarf Fortress.exe+8F7165 from 74 12 (je +12) to EB 12 (jmp +12). This reduces this bug from a crash to some weird behaviour (cut tree vanishes, leaving buildings on it floating in air. But weird behaviour is better than a crash isn't it?).

Of course, these are all done in a hurry and I do not guarantee they are 100% correct, nor do I guarantee the safety of the fix and am not responsible of any harm that might be done to your beloved dorfs using this method.

2015-08-23 06:26   
I have a game that crashed repeatedly, cause unknown but it was while floor-building in tree foliage was designated, so most likely it was this issue causing the crash, when the dwarfs eventually got around to building those floors. However, on the most recent attempt, they succeeded in building the floor, with strange results.

This was a fungiwood tree growing in a lake on the first cavern level. The second cavern level was very close to the first at that point, so on successive Z-levels top to bottom, we had: 1. foliage with floors designated for construction; 2. lake (7/7 water) and the fungiwood trunk; 3. open space of the second cavern layer.

When the dwarves built the floor, the entire tree vanished, leaving a cell of open space on the lake level where its trunk had been. No floor. That created an opening to the second cavern layer, and a dwarf fell through the hole, landing on a mushroom cap a couple Z-levels further down. However, the 7/7 water surrounding the open space did *not* flow into the space. I have a cell of dry open space connecting to the next layer, surrounded by 7/7 water.