From 38174633e23737bb711ab6d38856979b327d175c Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 13 Apr 2017 07:38:23 +0000 Subject: thread.c: disable VM events when stack overflow * thread.c (ruby_thread_stack_overflow): disable VM events when stack overflow occurred; it causes another stack overflow again in making backtrace object, and crashes. [ruby-core:80662] [Bug #13425] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_trace.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_trace.rb b/test/ruby/test_trace.rb index 77be94e9be..0be545e515 100644 --- a/test/ruby/test_trace.rb +++ b/test/ruby/test_trace.rb @@ -59,4 +59,19 @@ class TestTrace < Test::Unit::TestCase a.any? {true} }.value, bug2722) end + + def test_trace_stackoverflow + assert_normal_exit("#{<<-"begin;"}\n#{<<~"end;"}") + begin; + require 'tracer' + class HogeError < StandardError + def to_s + message.upcase # disable tailcall optimization + end + end + Tracer.stdout = open(IO::NULL, "w") + Tracer.on + HogeError.new.to_s + end; + end end -- cgit v1.2.3