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

ruby-changes:34414

From: nobu <ko1@a...>
Date: Sun, 22 Jun 2014 10:47:26 +0900 (JST)
Subject: [ruby-changes:34414] nobu:r46495 (trunk): signal.c: no cfunc frame at stack overflow

nobu	2014-06-22 10:47:14 +0900 (Sun, 22 Jun 2014)

  New Revision: 46495

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

  Log:
    signal.c: no cfunc frame at stack overflow
    
    * signal.c (check_stack_overflow): avoid pushing a cfunc frame,
      trying to fix stack overflow deadlock.

  Modified files:
    trunk/signal.c
Index: signal.c
===================================================================
--- signal.c	(revision 46494)
+++ signal.c	(revision 46495)
@@ -737,7 +737,8 @@ check_stack_overflow(const uintptr_t add https://github.com/ruby/ruby/blob/trunk/signal.c#L737
     /* SP in ucontext is not decremented yet when `push` failed, so
      * the fault page can be the next. */
     if (sp_page == fault_page || sp_page == fault_page + 1) {
-	ruby_thread_stack_overflow(GET_THREAD());
+	rb_thread_t *th = ruby_current_thread;
+	ruby_thread_stack_overflow(th);
     }
 }
 #else
@@ -745,7 +746,7 @@ static void https://github.com/ruby/ruby/blob/trunk/signal.c#L746
 check_stack_overflow(const void *addr)
 {
     int ruby_stack_overflowed_p(const rb_thread_t *, const void *);
-    rb_thread_t *th = GET_THREAD();
+    rb_thread_t *th = ruby_current_thread;
     if (ruby_stack_overflowed_p(th, addr)) {
 	ruby_thread_stack_overflow(th);
     }

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

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