ruby-changes:12053
From: matz <ko1@a...>
Date: Wed, 17 Jun 2009 12:56:46 +0900 (JST)
Subject: [ruby-changes:12053] Ruby:r23720 (trunk): * thread.c (ruby_thread_stack_overflow): call rb_exc_raise() on
matz 2009-06-17 12:56:29 +0900 (Wed, 17 Jun 2009) New Revision: 23720 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23720 Log: * 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] Modified files: trunk/ChangeLog trunk/thread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 23719) +++ ChangeLog (revision 23720) @@ -1,3 +1,11 @@ +Wed Jun 17 12:37:37 2009 Yukihiro Matsumoto <matz@r...> + + * 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@a...> * ext/objspace: added. objspace library extends some methods to Index: thread.c =================================================================== --- thread.c (revision 23719) +++ thread.c (revision 23720) @@ -1300,12 +1300,21 @@ 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->raised_flag = 0; +#ifdef USE_SIGALTSTACK + th->raised_flag = 0; + rb_exc_raise(sysstack_error); +#else th->errinfo = sysstack_error; - th->raised_flag = 0; TH_JUMP_TAG(th, TAG_RAISE); +#endif } int -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/