ruby-changes:51915
From: usa <ko1@a...>
Date: Mon, 30 Jul 2018 23:11:55 +0900 (JST)
Subject: [ruby-changes:51915] usa:r64129 (ruby_2_4): merge revision(s) 63727: [Backport #14865]
usa 2018-07-30 23:11:50 +0900 (Mon, 30 Jul 2018) New Revision: 64129 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64129 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_4/ Modified files: branches/ruby_2_4/test/ruby/test_settracefunc.rb branches/ruby_2_4/version.h branches/ruby_2_4/vm.c Index: ruby_2_4/test/ruby/test_settracefunc.rb =================================================================== --- ruby_2_4/test/ruby/test_settracefunc.rb (revision 64128) +++ ruby_2_4/test/ruby/test_settracefunc.rb (revision 64129) @@ -857,6 +857,21 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_settracefunc.rb#L857 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_4/version.h =================================================================== --- ruby_2_4/version.h (revision 64128) +++ ruby_2_4/version.h (revision 64129) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.5" #define RUBY_RELEASE_DATE "2018-07-30" -#define RUBY_PATCHLEVEL 309 +#define RUBY_PATCHLEVEL 310 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 7 Index: ruby_2_4/vm.c =================================================================== --- ruby_2_4/vm.c (revision 64128) +++ ruby_2_4/vm.c (revision 64129) @@ -1797,10 +1797,10 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/vm.c#L1797 while (th->cfp->pc == 0 || th->cfp->iseq == 0) { if (UNLIKELY(VM_FRAME_TYPE(th->cfp) == VM_FRAME_MAGIC_CFUNC)) { - EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, th->cfp->self, - rb_vm_frame_method_entry(th->cfp)->def->original_id, - rb_vm_frame_method_entry(th->cfp)->called_id, - rb_vm_frame_method_entry(th->cfp)->owner, Qnil); + EXEC_EVENT_HOOK_AND_POP_FRAME(th, RUBY_EVENT_C_RETURN, th->cfp->self, + rb_vm_frame_method_entry(th->cfp)->def->original_id, + rb_vm_frame_method_entry(th->cfp)->called_id, + rb_vm_frame_method_entry(th->cfp)->owner, Qnil); RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, rb_vm_frame_method_entry(th->cfp)->owner, rb_vm_frame_method_entry(th->cfp)->def->original_id); Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 64128) +++ ruby_2_4 (revision 64129) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r63727 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/