diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-17 03:56:29 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-17 03:56:29 +0000 |
| commit | b2f97ef05e9b250dadc0dc72494a4523dca81d67 (patch) | |
| tree | 1c9f4ed7138460d21d0cc674fc1555370c18219e /thread.c | |
| parent | b6b7c1ed0de7706ca8217b07ea4d9e8610a0a237 (diff) | |
| download | ruby-b2f97ef05e9b250dadc0dc72494a4523dca81d67.tar.gz ruby-b2f97ef05e9b250dadc0dc72494a4523dca81d67.tar.xz ruby-b2f97ef05e9b250dadc0dc72494a4523dca81d67.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@23720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
| -rw-r--r-- | thread.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 |
