Bugs: Browse | Submit New | Admin

[#21485] pure ruby illegal modification of set during iteration

Date:
2008-08-08 02:33
Priority:
3
Submitted By:
Nobody
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
pure ruby illegal modification of set during iteration

Detailed description
only occurs if export EVENTMACHINE_LIBRARY="pure_ruby"

[#<Thread:0x341ac run>][server][debug]: Starting main server event loop
/opt/local/lib/ruby/1.8/set.rb:220:in `delete': can't modify rbtree in iteration (TypeError)
	from /opt/local/lib/ruby/1.8/set.rb:220:in `delete'
	from /opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/pr_eventmachine.rb:332:in `run_timers'
	from /opt/local/lib/ruby/1.8/set.rb:195:in `each'
	from /opt/local/lib/ruby/1.8/set.rb:195:in `each_key'
	from /opt/local/lib/ruby/1.8/set.rb:195:in `each'
	from /opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/pr_eventmachine.rb:330:in `run_timers'
	from /opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/pr_eventmachine.rb:313:in `run'
	from /opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/pr_eventmachine.rb:309:in `loop'
	from /opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/pr_eventmachine.rb:309:in `run'
	from /opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/pr_eventmachine.rb:64:in `run_machine'
	from /opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:in `run'
	from escrub.rb:23:in `start'
	from escrub.rb:435
[paulcody@Macintosh-3]~/scrub$ 

problem is seen here:
  def run_timers
    @timers.each {|t|
      if t.first <= @current_loop_time
-->     @timers.delete t
	EventMachine::event_callback "", TimerFired, t.last
      else
        break
      end
    }
    #while @timers.length > 0 and @timers.first.first <= now
    #  t = @timers.shift
    #  EventMachine::event_callback "", TimerFired, t.last
    #end
  end

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item