summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-06 05:15:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-06 05:15:57 +0000
commitec826b3f93b9660825bb229251bfa28c27beea15 (patch)
tree17b79b5c2266688c5c9e186099191d1d5f854c9f /test
parente667897b46f5a112b29b7cbcc1e095e72841b40d (diff)
thread.c: deadlock in backtrace
* thread.c (unblock_function_set): check interrupts just once during raising exceptions, as they are deferred since r16651. [ruby-core:85939] [Bug #14577] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_exception.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 08e581d4f4..bb70bf508f 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -1200,6 +1200,28 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
end;
end
+ def test_blocking_backtrace
+ assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ begin;
+ class Bug < RuntimeError
+ def backtrace
+ IO.readlines(IO::NULL)
+ end
+ end
+ bug = Bug.new '[ruby-core:85939] [Bug #14577]'
+ n = 10000
+ i = 0
+ n.times do
+ begin
+ raise bug
+ rescue Bug
+ i += 1
+ end
+ end
+ assert_equal(n, i)
+ end;
+ end
+
def test_wrong_backtrace
assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}")
begin;