diff options
-rw-r--r-- | test/ruby/test_exception.rb | 22 | ||||
-rw-r--r-- | thread.c | 2 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 24 insertions, 2 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; @@ -385,7 +385,7 @@ set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, void *arg, } native_mutex_lock(&th->interrupt_lock); - } while (RUBY_VM_INTERRUPTED_ANY(th) && + } while (!th->raised_flag && RUBY_VM_INTERRUPTED_ANY(th) && (native_mutex_unlock(&th->interrupt_lock), TRUE)); if (old) *old = th->unblock; @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.4.4" #define RUBY_RELEASE_DATE "2018-03-25" -#define RUBY_PATCHLEVEL 286 +#define RUBY_PATCHLEVEL 287 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 3 |