Infinite loop in 0.7.4 #53

Closed
esdras opened this Issue Dec 19, 2011 · 15 comments

Comments

Projects
None yet
3 participants

esdras commented Dec 19, 2011

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:inwrite'
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:inputs'
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:ineach'
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:inblock 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:innext_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:ineach'
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:inloop'
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:inblock 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:infind_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:instart'
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<top (required)>'
from script/rails:6:in require' from script/rails:6:in

'ruby-1.9.2-p290 :005 > exit

Owner

seejohnrun commented Dec 19, 2011

Hey - thanks for the report.
I'm trying to duplicate this, but having a hard time getting it to happen.
What time was it locally when this occurred?

esdras commented Dec 20, 2011

Just duplicated it, check out this screenshot.

https://img.skitch.com/20111220-ekhp4e3irju9xaq1qb2gfapquf.jpg

As you can see, the error depends on the value of the :end_time argument. The image that I provided a Date object instead of a Time object to the :end_time argument. IceCube does not complain if you provide a Date object on rails console, but I tested with a Time object as well and the error occurred, both on the rails console and irb.

Again, ruby 1.9.2, rails 3.0.11, Mac OSX Lion

Hope this helps :)

Owner

seejohnrun commented Dec 20, 2011

I can duplicate this now, and will have a fix out for it in the next few days. Thanks so much for the report!

esdras commented Dec 20, 2011

I'm glad I could help. :)

forrest commented Jan 10, 2012

I got this on 0.7.6 too. PST zone.

forrest commented Oct 8, 2012

I think I might be hitting this with 0.8. Has it been resolved?

Owner

seejohnrun commented Oct 8, 2012

A new release will be out soon with a fix for this issue

forrest commented Oct 8, 2012

Thanks @seejohnrun. This infinite loop just took down our production. I've wrapped it in a timeout to avoid future server crashes, but obviously that's not an ideal solution.

Owner

seejohnrun commented Oct 8, 2012

Understood :)
Just been having some personal issues I've been dealing with - will have this out soon

forrest commented Oct 8, 2012

Would me adding a failing spec help, or do you already have a pretty good handle on the situation?

Owner

seejohnrun commented Oct 10, 2012

Have a good grip on the situation - appreciate the offer though

seejohnrun closed this Oct 10, 2012

seejohnrun reopened this Oct 10, 2012

Owner

seejohnrun commented Oct 12, 2012

This issue is fixed for v0.9.0, which should be out tomorrow afternoon - feel free to test against master. Thanks!

seejohnrun closed this Oct 12, 2012

forrest commented Oct 12, 2012

Thanks for getting to this so quickly :-)

Owner

seejohnrun commented Oct 12, 2012

womp wah

forrest commented Oct 12, 2012

haha, well it went fast for us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment