ruby-changes:52230
From: nagachika <ko1@a...>
Date: Sat, 18 Aug 2018 14:04:35 +0900 (JST)
Subject: [ruby-changes:52230] nagachika:r64438 (ruby_2_5): merge revision(s) 63727: [Backport #14865]
nagachika 2018-08-18 14:04:31 +0900 (Sat, 18 Aug 2018) New Revision: 64438 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64438 Log: merge revision(s) 63727: [Backport #14865] vm.c: fix infinite loop * vm.c: use EXEC_EVENT_HOOK_AND_POP_FRAME. While exception handling, if an exception is raised in hooks, need to pop current frame and raise this raised exception by hook. [ruby-dev:50582] [Bug #14865] Modified directories: branches/ruby_2_5/ Modified files: branches/ruby_2_5/test/ruby/test_settracefunc.rb branches/ruby_2_5/version.h branches/ruby_2_5/vm.c Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 64437) +++ ruby_2_5/version.h (revision 64438) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.2" #define RUBY_RELEASE_DATE "2018-08-18" -#define RUBY_PATCHLEVEL 79 +#define RUBY_PATCHLEVEL 80 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 8 Index: ruby_2_5/vm.c =================================================================== --- ruby_2_5/vm.c (revision 64437) +++ ruby_2_5/vm.c (revision 64438) @@ -1802,10 +1802,10 @@ vm_exec(rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/ruby_2_5/vm.c#L1802 while (ec->cfp->pc == 0 || ec->cfp->iseq == 0) { if (UNLIKELY(VM_FRAME_TYPE(ec->cfp) == VM_FRAME_MAGIC_CFUNC)) { - EXEC_EVENT_HOOK(ec, RUBY_EVENT_C_RETURN, ec->cfp->self, - rb_vm_frame_method_entry(ec->cfp)->def->original_id, - rb_vm_frame_method_entry(ec->cfp)->called_id, - rb_vm_frame_method_entry(ec->cfp)->owner, Qnil); + EXEC_EVENT_HOOK_AND_POP_FRAME(ec, RUBY_EVENT_C_RETURN, ec->cfp->self, + rb_vm_frame_method_entry(ec->cfp)->def->original_id, + rb_vm_frame_method_entry(ec->cfp)->called_id, + rb_vm_frame_method_entry(ec->cfp)->owner, Qnil); RUBY_DTRACE_CMETHOD_RETURN_HOOK(ec, rb_vm_frame_method_entry(ec->cfp)->owner, rb_vm_frame_method_entry(ec->cfp)->def->original_id); Index: ruby_2_5/test/ruby/test_settracefunc.rb =================================================================== --- ruby_2_5/test/ruby/test_settracefunc.rb (revision 64437) +++ ruby_2_5/test/ruby/test_settracefunc.rb (revision 64438) @@ -855,6 +855,21 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_settracefunc.rb#L855 end end + def test_tracepoint_exception_at_c_return + assert_nothing_raised(Timeout::Error, 'infinite trace') do + assert_normal_exit %q{ + begin + TracePoint.new(:c_return){|tp| + raise + }.enable{ + tap{ itself } + } + rescue + end + }, '', timeout: 3 + end + end + def test_tracepoint_with_multithreads assert_nothing_raised do TracePoint.new{ Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 64437) +++ ruby_2_5 (revision 64438) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r63727 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/