[#30549] [ANN] Ruby 1.8.6 has been released — "Akinori MUSHA" <knu@...>

 Ruby 1.8.6 をリリースしました。

14 messages 2007/03/12

[#30553] help: lib/shell for ruby 1.9 — keiju@... (Keiju ISHITSUKA)

けいじゅ@いしつかです.

13 messages 2007/03/13
[#30585] Re: help: lib/shell for ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/03/15

まつもと ゆきひろです

[#30587] Re: help: lib/shell for ruby 1.9 — keiju@... (石塚圭樹) 2007/03/15

けいじゅ@いしつかです.

[#30588] Re: help: lib/shell for ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/03/15

まつもと ゆきひろです

[ruby-dev:30653] [BUG] queue 0x424010 freed with live thread(s) waiting

From: Masatoshi SEKI <m_seki@...>
Date: 2007-03-20 13:50:05 UTC
List: ruby-dev #30653
咳といいます。


出遅れてしまいましたが、やっとsvn版を試し始めました。

1.8系のブランチはruby_1_8でよいのでしたっけ?

次のスクリプトのようなQueueを待ってるスレッドがある状態で
メインスレッドが終了するケースで
 [BUG] queue 0x424010 freed with live thread(s) waiting
となりました。

再現したのはこの版です。配布されている1.8.6では問題ありません。
ruby 1.8.6 (2007-03-20 patchlevel 5000) [powerpc-darwin8.9.0]


-----lb.rb------

require 'thread'

class LocalBarrier
  def initialize(n)
    @wait = Queue.new
    @done = Queue.new
    @keeper = begin_keeper(n)
  end

  def sync
    @done.push(true)
    @wait.pop
  end

  def join
    @keeper.join
  end

  private
  def begin_keeper(n)
    Thread.start do
      n.times do
        @done.pop
      end
      n.times do
        @wait.push(true)
      end
    end
  end
end

n = 10

lb = LocalBarrier.new(n)

(n - 1).times do |i|
  Thread.start do
    sleep(rand(n) + 1)
    puts "#{i}: done"
    lb.sync
    puts "#{i}: cont"
  end
end

lb.sync
puts "#{n-1}: cone"

# lb.join # <-- これをコメントアウトすると再現します。

puts "exit."

----------------


svn版では次の通り失敗します。

four: mas$ ruby -dv lb.rb
ruby 1.8.6 (2007-03-20 patchlevel 5000) [powerpc-darwin8.9.0]
1: done
5: done
8: done
3: done
2: done
7: done
0: done
6: done
4: done
9: cone
exit.
lc.rb:50: [BUG] queue 0x424010 freed with live thread(s) waiting
ruby 1.8.6 (2007-03-20) [powerpc-darwin8.9.0]

Abort trap


配布されている1.8.6では問題ありません。

four: mas$ ruby -dv lb.rb
ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.9.0]
1: done
7: done
6: done
8: done
0: done
4: done
3: done
2: done
5: done
9: cone
exit.



In This Thread

Prev Next