mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread.c (ruby_thread_stack_overflow): call rb_exc_raise() on
stack overflows in the signal handler, if sigaltstack is available. On stack overflow (and with sigaltstack), the signal handler is more likely to have room to create an exception object. [ruby-core:23813] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
39a770b720
commit
945ea61cd7
2 changed files with 18 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
Wed Jun 17 12:37:37 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* thread.c (ruby_thread_stack_overflow): call rb_exc_raise() on
|
||||
stack overflows in the signal handler, if sigaltstack is
|
||||
available. On stack overflow (and with sigaltstack), the signal
|
||||
handler is more likely to have room to create an exception
|
||||
object. [ruby-core:23813]
|
||||
|
||||
Wed Jun 17 08:10:38 2009 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* ext/objspace: added. objspace library extends some methods to
|
||||
|
|
11
thread.c
11
thread.c
|
@ -1300,12 +1300,21 @@ rb_threadptr_signal_exit(rb_thread_t *th)
|
|||
rb_threadptr_raise(th->vm->main_thread, 2, argv);
|
||||
}
|
||||
|
||||
#if defined(POSIX_SIGNAL) && defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
|
||||
#define USE_SIGALTSTACK
|
||||
#endif
|
||||
|
||||
void
|
||||
ruby_thread_stack_overflow(rb_thread_t *th)
|
||||
{
|
||||
th->errinfo = sysstack_error;
|
||||
th->raised_flag = 0;
|
||||
#ifdef USE_SIGALTSTACK
|
||||
th->raised_flag = 0;
|
||||
rb_exc_raise(sysstack_error);
|
||||
#else
|
||||
th->errinfo = sysstack_error;
|
||||
TH_JUMP_TAG(th, TAG_RAISE);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue