(I see r4 is out - will try that shortly, the following is for r3)
Doing some testing with fix/growthbug.rb on linux. Based on what I'm seeing for unit birth_times - mostly 0, 1, double digit ints, or huge positive/negative ints - and the large number getting modified every time I run - ~100 "fixed" each time I run "fix/growthbug now", once a second immediately after start - I would guess that perhaps the birth_time variable is not mapping to the correct memory location. This theory is bolstered by the fact that the hang happens when an assignment is attempted - running a version of the script that does not write to unit.relation.birth_time works just fine.
Thoughts?
Cut-n-paste of current (ie not original, modified for testing) code snippet:
def process
count = 0
df.world.units.active.each do |unit|
if unit and unit.relations and unit.relations.birth_time then
puts "unit has birth_time #{unit.relations.birth_time}"
if unit.relations.birth_time > 0 then
r = unit.relations.birth_time % 10
if r > 0 then
unit.relations.birth_time -= r
puts " unit now has birth_time #{unit.relations.birth_time}"
count += 1
end
end
end
end
puts "FixGrowth: Fixed #{count} units so that their size will grow/thicken." unless count == 0
End of output just before hang:
unit has birth_time 0
unit has birth_time 7012459
unit now has birth_time 7012450
unit has birth_time 0
unit has birth_time 0
unit has birth_time 0
unit has birth_time 0
unit has birth_time 274006465
unit now has birth_time 274006460
unit has birth_time -1
unit has birth_time 40
unit has birth_time 0
unit has birth_time -1
unit has birth_time -1718639376
unit has birth_time 0
unit has birth_time 0
unit has birth_time -1702744808
unit has birth_time 1
unit now has birth_time 0
unit has birth_time 69
unit now has birth_time 60
unit has birth_time -1258291026
unit has birth_time 35
unit now has birth_time 30
unit has birth_time 0
unit has birth_time 0
unit has birth_time -1370843632
unit has birth_time 50332165
unit now has birth_time 50332160
unit has birth_time 69
unit now has birth_time 60
unit has birth_time 0
unit has birth_time 0
unit has birth_time 0
FixGrowth: Fixed 106 units so that their size will grow/thicken.
[DFHack]# fix/growthbug now
(hung)