diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-22 01:47:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-22 01:47:14 +0000 |
commit | 2af4240fbb4f91dba2acee02e83d5f05627084fd (patch) | |
tree | 1f787a4118fa57f405ab16082d3677730cbd0989 /signal.c | |
parent | c7a7e60409cc003e6dc8b74e71f6b0533f8406dc (diff) | |
download | ruby-2af4240fbb4f91dba2acee02e83d5f05627084fd.tar.gz |
signal.c: no cfunc frame at stack overflow
* signal.c (check_stack_overflow): avoid pushing a cfunc frame,
trying to fix stack overflow deadlock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -737,7 +737,8 @@ check_stack_overflow(const uintptr_t addr, const ucontext_t *ctx) /* 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 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); } |