Ticket #620 (closed defect: fixed)
Yielding a block inside a loop in a thread crashes the VM
| Reported by: | honglilai@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | blocker | Milestone: | MacRuby 0.7 |
| Component: | MacRuby | Keywords: | |
| Cc: | ernest.prabhakar@…, dylan@… |
Description
Yielding a block inside a loop directly in the Thread block results in a VM crash:
Assertion failed: ((b->flags & flags) == flags), function rb_vm_prepare_block, file dispatcher.cpp, line 1737. Abort trap
Interestingly, the problem doesn't occur of the loop is wrapped inside a function.
Reproduce with:
require 'thread' def do_yield yield end # This doesn't crash. Thread.new do do_yield do end do_yield do end do_yield do end end.join # This doesn't crash either. def do_yield_loop_in_function while true do_yield do end end end Thread.new do do_yield_loop_in_function end.join # This crashes. Thread.new do 3.times do do_yield do end end end.join # This crashes too. Thread.new do while true do_yield do end end end.join
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


