From e64e3c4c21361565fa03c49292e6918e0eb7f693 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 15 Jun 2017 07:16:17 +0000 Subject: Prohibit SystemStackError while GC. * vm_insnhelper.c (rb_threadptr_stack_overflow): fatal on GC [Bug #13662] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vm_insnhelper.c b/vm_insnhelper.c index df9ea84d50..83ebe37124 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -56,8 +56,11 @@ NORETURN(void rb_threadptr_stack_overflow(rb_thread_t *th)); void rb_threadptr_stack_overflow(rb_thread_t *th) { + if (rb_during_gc()) { + rb_fatal("machine stack overflow while GC is running."); + } #ifdef USE_SIGALTSTACK - threadptr_stack_overflow(th, !rb_threadptr_during_gc(th)); + threadptr_stack_overflow(th, TRUE); #else threadptr_stack_overflow(th, FALSE); #endif -- cgit v1.2.3