Last active
December 16, 2015 23:38
-
-
Save benweint/5514906 to your computer and use it in GitHub Desktop.
Demonstration of nil backtraces in Ruby. nil backtraces show up sometimes in MRI. In JRuby-1.7.3, NullPointerExceptions show up for the backtracing thread.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
Thread.new do | |
loop do | |
Thread.list.each do |t| | |
puts "Got a nil backtrace for thread #{t}" if t.backtrace.nil? | |
end | |
end | |
end | |
loop { Thread.new { sleep 0.001 }.join } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment