From a98e343d39c4d7bf1e2190b076720f32d9f298b3 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 17 Dec 2013 07:19:25 +0000 Subject: vm_trace.c: isolate exceptions * vm_trace.c (rb_postponed_job_flush): isolate exceptions in postponed jobs and restore outer ones. based on a patch by tarui. [ruby-core:58652] [Bug #9168] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_gc.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index eb8d019679..1a7b38dbea 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -279,6 +279,19 @@ class TestGc < Test::Unit::TestCase end end + def test_exception_in_finalizer + bug9168 = '[ruby-core:58652] [Bug #9168]' + assert_normal_exit(<<-'end;', bug9168) + raise_proc = proc {raise} + 10000.times do + ObjectSpace.define_finalizer(Object.new, raise_proc) + Thread.handle_interrupt(RuntimeError => :immediate) {break} + Thread.handle_interrupt(RuntimeError => :on_blocking) {break} + Thread.handle_interrupt(RuntimeError => :never) {break} + end + end; + end + def test_verify_internal_consistency assert_nil(GC.verify_internal_consistency) end -- cgit v1.2.3