Issue #236 has been reported by Rados??aw Bu??at.

----------------------------------------
Bug #236: Segfault when multiple threads
http://redmine.ruby-lang.org/issues/show/236

Author: Rados??aw Bu??at
Status: Open
Priority: High
Assigned to: Koichi Sasada
Category: 
Target version: 


$ ruby1.9 -v
ruby 1.9.0 (2008-07-09 revision 17963) [x86_64-linux]

$ uname -a
Linux ruby 2.6.24-19-generic #1 SMP Wed Jun 18 14:15:37 UTC 2008 x86_64 GNU/Linux

  $queue = []

  def produce
    $queue << true if rand(10) < 5
  end

  loop do
    produce
    while client = $queue.shift do
      Thread.new(client) do |c|
        raise "bug" if c == false
      end
      puts Thread.list.size
    end
  end

when I run this program I get:

bug.rb:11: [BUG] Segmentation fault
ruby 1.9.0 (2008-07-09 revision 17963) [x86_64-linux]

-- control frame ----------
c:0003 p:0007 s:0007 b:0005 l:002308 d:000004 BLOCK  bug.rb:11
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH 
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP    
---------------------------
DBG> : "bug.rb:11:in `block (2 levels) in <main>'"
-- backtrace of native function call (Use addr2line) --
0x7f0a4f40d5b1
0x7f0a4f34d239
0x7f0a4f34d393
0x7f0a4f3c849d
0x7f0a4f0f67d0
0x7f0a4f3fb936
0x7f0a4f3fb993
0x7f0a4f4025b3
0x7f0a4f4060bd
0x7f0a4f4085cb
0x7f0a4f411fbb
0x7f0a4f41204e
0x7f0a4f0ee3f7
0x7f0a4e597b2d
-------------------------------------------------------
Aborted

Unfortunately addr2line doesn't produce useful info:

??:0
??:0
??:0
...


----------------------------------------
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account