Skip to content

Instantly share code, notes, and snippets.

@eric
Created May 15, 2012 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eric/2699585 to your computer and use it in GitHub Desktop.
Save eric/2699585 to your computer and use it in GitHub Desktop.
segfault in MRI 1.8.7 that I tracked down with @slyphon
require 'thread'
# This seems to crash 1.8.7
10.times { Thread.new { Queue.new.pop } }
Process.waitpid fork { GC.start; puts "In child: #{$$}" }
require 'thread'
# This seems to crash 1.8.7 as well
10.times { Thread.new { m = Mutex.new; c = ConditionVariable.new; m.synchronize { c.wait(m) } } }
Process.waitpid fork { GC.start; puts "In child: #{$$}" }
$ ruby crash_a_187.rb
crash_a_187.rb:5: [BUG] Segmentation fault
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]
$ ruby crash_an_187.rb
crash_an_187.rb:5: [BUG] Segmentation fault
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment