Actions
Bug #4140
closedsegfault recursion inside a thread
Description
=begin
The code below (thanks to flavorjones from Nokogiri) makes ruby 1.9.2 to segfault. It works with 1.8.7 or without the thread, just raising a SystemStackError (stack level too deep).
You can find the stack trace attached.
DEPTH = 2000
def recurse(offset)
STDERR.puts offset
if offset >= DEPTH
"done"
else
[1].inject("") do |y, child|
recurse(offset+1)
y
end
end
end
th=Thread.new {
puts recurse(0).inspect
}
th.join
=end
Files
Actions
Like0
Like0