* signal.c (check_stack_overflow): use mcontext_t. the struct tag
name is not portable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (check_stack_overflow): raise SystemStackError if SP
register and fault address is in the same page or the next, on
x86 Mac OS X. [EXPERIMENTAL]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (check_stack_overflow): check the next page too. SP in
ucontext is not decremented yet when `push` failed, so the fault
page can be the next.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (rb_f_kill): directly enqueue an ignored signal to self,
except for SIGSEGV and SIGBUS. [ruby-dev:48203] [Bug #9820]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (check_stack_overflow): raise SystemStackError if SP
register and fault address is in the same page, on x86 linux.
[EXPERIMENTAL]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (sigbus, sigsegv): show fault address in the bug message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/ruby/test_exception.rb on Windows.
wrap by __try and __exception statements on mswin to raise SIGSEGV
when EXCEPTION_STACK_OVERFLOW is occurred, because MSVCRT doesn't
handle the exception.
however, (1) mingw-gcc doesn't support __try and __exception
statements, and (2) we cannot retry SystemStackError after this
change yet (maybe crashed) because SEH and longjmp() are too
uncongenial.
* signal.c (check_stack_overflow, CHECK_STACK_OVERFLOW): now defined on
Windows, too.
* thread_win32.c (ruby_stack_overflowed_p): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (sighandler_t): get rid of clash with system provided name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
unistd.h is now included via ruby/defines.h, but should implicitly
include here. (suggested by kosaki)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/envutil.rb (assert_ruby_status): show status info.
* test/ruby/envutil.rb (Test::Unit::Assertions::FailDesc): use
Signal.signame for consistency with Process::Status#inspect.
* signal.c (siglist): prefer SIGABRT over SIGIOT in Signal.signame.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c (ruby_kill): helper function of kill().
* signal.c (rb_f_kill): use ruby_kill() instead of kill().
* signal.c (rb_f_kill): call rb_thread_execute_interrupts()
to ensure that make SignalException if sent a signal
to myself. [Bug #7951] [ruby-core:52864]
* vm_core.h (typedef struct rb_thread_struct): added
th->interrupt_cond.
* thread.c (rb_threadptr_interrupt_common): added to
initialization of th->interrupt_cond.
* thread.c (thread_create_core): ditto.
* test/ruby/test_signal.rb (TestSignal#test_hup_me): test for
the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
from Thread.async_interrupt_timing to Thread.handle_interrupt,
from Thread.async_interrupted? to Thread.pending_interrupt?.
Also rename option from `defer' to `never'.
[ruby-core:51074] [ruby-trunk - Feature #6762]
* vm_core.c, thread.c: rename functions and data structure
`async_errinfo' to `pending_interrupt'.
* thread.c: add global variables sym_immediate, sym_on_blocking and
sym_never.
* cont.c, process.c, vm.c, signal.c: ditto.
* lib/sync.rb, lib/thread.rb: catch up this renaming.
* test/ruby/test_thread.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
sigsegv handler. enlarge value when x86 or x86_64 on Linux.
Linux has very small MINSIGSTKSZ size (2048 bytes) and
our sigsegv routine need 5KiB at least. [Bug #7141]
* internal.h: add declaration of rb_sigaltstack_size().
* vm_core.h: remove ALT_STACK_SIZE definition.
* signal.c (rb_register_sigaltstack): replace ALT_STACK_SIZE with
rb_sigaltstack_size();
* gc.c (Init_heap): ditto.
* vm.c (th_init): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
has no good effect and makes meaningless 100ms delay. 1)
when sending signal to another process, waiting has just silly.
2) when sending signal to current process, 100ms is often not
enough time to wait. It depend on kernel behavior. And,
rb_thread_polling() doesn't make sense anyway. When rb_thread_alone()
is true, it doesn't wait at all and Process.kill() users don't
expect threading changes Process.kill() behavior. [Bug #7560]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h, signal.c (NEED_RUBY_ATOMIC_OPS): renamed from
NEED_RUBY_ATOMIC_EXCHANGE.
* signal.c (ruby_atomic_compare_and_swap): naive, non-atomic
compare-and-swap implementation only used for platforms without
valid support for atomic operations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
running trap handler.
* signal.c (signal_exec): turn on in_trap when running trap.
* thread.c (Init_Thread, thread_create_core): initialize in_trap
when creating new threads.
* thread.c (thread_join_m): raise ThreadError when running trap
handler.Bug [#6416][ruby-core:44956]
* test/ruby/test_thread.rb (test_thread_join_in_trap): new test
for the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
disabling. pthread_sigmask() only changes current thread
mask.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
USE_TRAP_MASK.
* signal.c (trap_arg, trap_ensure): removed.
* signal.c (trap, sig_trap): removed pointless signal disabling.
We don't need it bacause we no longer run trap hander on signal
hander context.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Feature #5613]
* test/ruby/test_signal.rb (test_signame): adds test for above
* NEWS: add an item about above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
on Solaris 10. [ruby-dev:46414] [Bug #7287]
* gc.c, signal.c, vm_core.h, common.mk: reflect the rename from atomic.h
to ruby_atomic.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Update documentation for Process.kill to reflect kill(2)
Patch by Richo Healey
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
- -lbe is not required for linking
- stack protector doesn't work for now because of the default gcc's bug
by Takashi Toyoshima <toyoshim@gmail.com>
https://github.com/ruby/ruby/pull/167
* signal.c (ruby_signal): haiku doesn't have SIGBUS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e