View Issue Details

IDProjectCategoryView StatusLast Update
0003655Dwarf FortressWorld Generation -- Beastspublic2014-03-30 12:24
Reporterrephikul Assigned Touser11 
PrioritylowSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
OSWindows XP Service Pack 3 
Product Version0.31.18 
Summary0003655: Integer overflow causes Null Pop Num error when creating worlds using very high beast pop cap
DescriptionI tried to make worlds with high POPULATION_NUMBER and some creatures are reported to have null pop num, probably because of overflow maybe? The game doesnt crash and legend still report such and such animals populated although the amount is tad random. One example that stuck out: mandrill has pop cap set to 20000:50000, got a "mandrills: Null Pop Num" error but legend report world wide population of 150. An another example is rhesus which got two errors in one single world gen. On the other hand floating guts [POPULATION_NUMBER:250000:500000] didnt show up at all during the tests. The reproducibility of this error on an exact species is random however the chance of it showing up at all during world gen is extremely high.
Steps To Reproduce1) Change [POPULATION_NUMBER:<min>:<max>] of as many creatures as possible to 10000x fold i.e. 20:50 -> 20000:50000
2) Start DF, create a new world
3) Check error log
Additional InformationAmount of tests run: 7
Reproducibility Result: 7/7
Amount of "null pop num error"s each world gen: handsful
TagsNo tags attached.

Activities

rephikul

2010-12-02 13:50

reporter   ~0014373

Later testing show that this error only show up if the creature has pop somewhere above 30k. Considering 2^15 = 32768, this is most certainly an overflow related issue. Strangely enough very high popped creatures (250k:500k range) very rarely got this error.

Quietust

2010-12-02 14:43

reporter   ~0014375

I can confirm (via disassembly) that the min and max values are both 16-bit.

Add Note

Note

Issue History

Date Modified Username Field Change
2010-11-17 10:05 rephikul New Issue
2010-12-02 13:50 rephikul Note Added: 0014373
2010-12-02 14:43 Quietust Note Added: 0014375
2012-03-06 09:30 user6 Summary Null Pop Num error on some beasts when creating worlds using very high beast pop cap => Integer overflow causes Null Pop Num error when creating worlds using very high beast pop cap
2014-03-30 12:24 user11 Assigned To => user11
2014-03-30 12:24 user11 Status new => acknowledged