diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-25 05:54:39 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-25 05:54:39 +0000 |
commit | e59be153682d6240b2dd571c2272fb31f905d84c (patch) | |
tree | 6d9ea0e6af4d106166595368dfaa5fc348ce6f55 /test | |
parent | 9869b65573d5bbaf5af4f20a577b41f95d73b846 (diff) |
merge revision(s) 62673: [Backport #14577]
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/branches/ruby_2_4@62917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_exception.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index ee212083a3..8eb92faa08 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1031,6 +1031,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; |