Bug #2246
closedsegfault instead of SystemStackError in 1.8.x
Description
=begin
class Go
def method_missing meth, *args
[].send meth, *args { |*incoming_args| yield(*incoming_args) }
end
end
Go.new.pop
results in
rdp@rdp-vm:/free_space/rdp/ruby/all_gems_rdocs$ ruby -v attempt_recreate.rb
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
Segmentation fault
on 1.8.7 linux. (ok in 1.9, windows 1.8.6).
Thanks.
=end
Updated by matz (Yukihiro Matsumoto) over 14 years ago
=begin
Hi,
In message "Re: [ruby-core:26216] [Bug #2246] segfault instead of SystemStackError in 1.8.x"
on Wed, 21 Oct 2009 23:56:00 +0900, Roger Pack redmine@ruby-lang.org writes:
|Bug #2246: segfault instead of SystemStackError in 1.8.x
It's know issue. Ruby interpreter checks stack depth periodically, so
when stack grows too fast, it causes SEGV before next depth check.
Frequent checks would prevent the problem, but slows down the
interpreter a lot.
matz.
=end
Updated by rogerdpack (Roger Pack) over 14 years ago
- Status changed from Open to Rejected
=begin
Thanks for the answer.
Interesting that it reports the overflow appropriately in 1.9 but not 1.8. Perhaps 1.9 should be made to check less often, to make it faster?
Another thought would be to possibly create a guard page at the end of each stack, mentioned here
http://timetobleed.com/fixing-threads-in-ruby-18-a-2-10x-performance-boost/
then not have to check at all.
Thoughts?
-r
=end