Ticket #816 (closed defect: fixed)
Assertion fails on multi-threaded code
| Reported by: | mootoh@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | minor | Milestone: | MacRuby 0.7 |
| Component: | MacRuby | Keywords: | |
| Cc: |
Description
I tried the following simple multi-threaded code snippet on MacRuby 0.6 (release build, obtained from http://www.macruby.org/downloads.html, universal-darwin10.0, x86_64), and it aborted with following assertion:
Assertion failed: ((b->flags & flags) == flags), function rb_vm_prepare_block, file dispatcher.cpp, line 1773.
Code snippet to reproduce this issue:
N=2
M=1000000
def compute_intensive n
r = 0
M.times do |i|
M.times do |j|
r = i * j + n
end
end
r
end
threads = []
N.times do |i|
th = Thread.new do
compute_intensive i
end
threads.push th
end
threads.each { |thread| thread.join }
I tried both ruby 1.8.7 (2009-06-12 patchlevel 174) and ruby 1.9.2dev (2009-08-30 trunk 24718), and those produced no error.
Change History
Note: See
TracTickets for help on using
tickets.

