seejohnrun/ice_cube — Issue #53: Infinite loop in 0.7.4
Author: esdras
Created: 2011-12-19 21:31:05+00:00
State: open

I upgraded from version 0.6.14 to 0.7.4, then I noticed a infinite loop while running my specs. Digging more deep I found where the infinite loop was taking place. I'll paste some debug prints and a backtrace. I hope this will help you guys to fix the problem. One thing that may be worth noting is that I live in Brazil (GMT-03:00, GMT-02:00 at the time of the tests due summer time)

I downgraded to 0.6.14 and it worked.

OS: Mac OSX Lion
Ruby: 1.9.2

# The code below was executed using rails console
sc = IceCube::Schedule.new Time.now, :end_time => 4.years.from_now.end_of_year
sc.add_recurrence_rule :monthly
sc.occurrences 2.years.from_now

# Debugging prints and backtrace
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300
clearing
2013-10-19 23:00:00 -0300^CIRB::Abort: abort then interrupt!!
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:41:in `call'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:41:in `write'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:41:in `puts'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:41:in `puts'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:41:in `block (2 levels) in next_time'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:25:in `each'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:25:in `all?'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:25:in `block in next_time'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:24:in `loop'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/validated_rule.rb:24:in `next_time'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/schedule.rb:302:in `block (2 levels) in next_time'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/schedule.rb:300:in `each'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/schedule.rb:300:in `block in next_time'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/schedule.rb:299:in `loop'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/schedule.rb:299:in `next_time'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/schedule.rb:285:in `block in find_occurrences'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/schedule.rb:284:in `loop'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/schedule.rb:284:in `find_occurrences'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/ice_cube-0.7.4/lib/ice_cube/schedule.rb:123:in `occurrences'
from (irb):4
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/railties-3.0.11/lib/rails/commands/console.rb:44:in `start'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/railties-3.0.11/lib/rails/commands/console.rb:8:in `start'
from /Users/esdrasmayrink/.rvm/gems/ruby-1.9.2-p290@organizze/gems/railties-3.0.11/lib/rails/commands.rb:23:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'ruby-1.9.2-p290 :005 > exit