[前][次][番号順一覧][スレッド一覧]

ruby-changes:47490

From: nobu <ko1@a...>
Date: Wed, 16 Aug 2017 16:18:52 +0900 (JST)
Subject: [ruby-changes:47490] nobu:r59606 (trunk): vm_insnhelper.c: cfp error at stack overflow

nobu	2017-08-16 16:18:45 +0900 (Wed, 16 Aug 2017)

  New Revision: 59606

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59606

  Log:
    vm_insnhelper.c: cfp error at stack overflow
    
    * vm_insnhelper.c (threadptr_stack_overflow): set stack overflow
      flag until handling execptions, to get rid of cfp consistency
      error when exec tag was rewound.  [ruby-core:80618] [Bug #13412]

  Modified files:
    trunk/vm.c
    trunk/vm_insnhelper.c
Index: vm.c
===================================================================
--- vm.c	(revision 59605)
+++ vm.c	(revision 59606)
@@ -1808,6 +1808,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1808
 	const rb_control_frame_t *escape_cfp;
 
 	err = (struct vm_throw_data *)th->ec.errinfo;
+	rb_thread_raised_reset(th, RAISED_STACKOVERFLOW);
 
       exception_handler:
 	cont_pc = cont_sp = 0;
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 59605)
+++ vm_insnhelper.c	(revision 59606)
@@ -35,7 +35,7 @@ static void https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L35
 threadptr_stack_overflow(rb_thread_t *th, int setup)
 {
     VALUE mesg = th->vm->special_exceptions[ruby_error_sysstack];
-    th->ec.raised_flag = 0;
+    th->ec.raised_flag = RAISED_STACKOVERFLOW;
     if (setup) {
 	VALUE at = rb_threadptr_backtrace_object(th);
 	mesg = ruby_vm_special_exception_copy(mesg);
@@ -1833,6 +1833,8 @@ vm_profile_show_result(void) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1833
 
 #define CHECK_CFP_CONSISTENCY(func) \
     (LIKELY(reg_cfp == th->ec.cfp + 1) ? (void) 0 : \
+     rb_thread_raised_p(th, RAISED_STACKOVERFLOW) ? \
+     rb_thread_raised_reset(th, RAISED_STACKOVERFLOW) : \
      rb_bug(func ": cfp consistency error (%p, %p)", reg_cfp, th->ec.cfp+1))
 
 static inline

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]