summaryrefslogtreecommitdiff
path: root/signal.c
AgeCommit message (Collapse)Author
2014-09-09* gc.c: remvoe ruby_disable_gc_stress and add ruby_disable_gcko1
to speed-up newobj_of(). * gc.c (ready_to_gc): check ruby_disable_gc. * signal.c: use ruby_disable_gc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-05* signal.c (ruby_signal): Don't set SA_SIGINFO for SIG_IGN andakr
SIG_DFL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-30signal.c: preserve encodingnobu
* signal.c (rb_f_kill, trap_signm): preserve argument encoding in error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-30get rid of function calls in RSTRING_PTRnobu
* process.c (rlimit_resource_type, rlimit_resource_value): get rid of function calls in RSTRING_PTR(), as it evaluates the argument twice. * re.c (match_backref_number): ditto. * signal.c (esignal_init, rb_f_kill, trap_signm): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-30* process.c (rlimit_resource_type, rlimit_resource_value):ktsj
get rid of inadvertent dynamic symbol pin-down. * re.c (match_backref_number): ditto. * signal.c (esignal_init, rb_f_kill, trap_signm): ditto. * transcode.c (econv_opts): ditto. * vm_trace.c (symbol2event_flag): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-28symbols instead of IDsnobu
* encoding.c (rb_enc_get_index): deal with symbols instead of IDs to get rid of inadvertent pin-downs. * enum.c (chunk_ii): ditto. * enumerator.c (append_method): ditto. * iseq.c (iseq_load): ditto. * marshal.c (w_symbol, r_symlink, r_symreal, r_symbol): ditto. * signal.c (trap_handler): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-16revert r46834 because it does not pass testsko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-16* vm_core.h: remove rb_vm_t::trap_list[RUBY_NSIG], but addko1
rb_vm_t::trap_list_cmds (an array) and rb_vm_t::trap_list_safes[RUBY_NSIG] (separate to two different array). This modification reduce root objects. * signal.c: ditto. * vm.c (rb_vm_mark): remove marking code for rb_vm_t::trap_list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-03Init functions don't need ID cachesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-23signal.c: drop dangerous tagnobu
* signal.c (check_stack_overflow): drop the last tag too close to the fault page, to get rid of stack overflow deadlock. [Bug #9971] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-22signal.c: no cfunc frame at stack overflownobu
* 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
2014-06-18constify parametersnobu
* include/ruby/intern.h: constify `argv` parameters. * include/ruby/ruby.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-29signal.c: return proper membernobu
* signal.c (ruby_signal): should return either `old.sa_sigaction` or `old.sa_handler`, depending on whether `SA_SIGINFO` is set in `old.sa_flags`, because they may not be a union. [ruby-core:62836] [Bug #9878] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28signal: remove window for SignalException on IGNOREnormal
* signal.c (signal_exec): ignore immediate cmd for SIG_IGN * signal.c (trap_handler): set cmd to true for SIG_IGN * signal.c (trap): handle nil and true values for oldcmd [Bug #9835] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25signal.c: revert part of r46100nobu
* signal.c (check_stack_overflow): revert part of r46100, the previous condition was correct, and fix compilation error on other architecture linux. [ruby-core:62746] [Bug #9862] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25report bug with machine regisitersnobu
* error.c (rb_bug_context): new function to report bug with context. * vm_dump.c (rb_vm_bugreport): accepts `ucontext_t` argument to dump machine regisiters. based on [GH-584]. * signal.c (sigbus, sigsegv): dump machine regisiters if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25signal.c: fix stack overflow check on Mac OS Xnobu
* signal.c (check_stack_overflow): fix condition to use ucontext register, mcontext_t dereference, and its member names, on Mac OS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18signal.c: use mcontext_tnobu
* 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
2014-05-18signal.c: check stack overflow by SPnobu
* 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
2014-05-12signal.c: check the next page toonobu
* 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
2014-05-11signal.c: directly deliver non-handlable signalsnobu
* signal.c (rb_f_kill): directly deliver signals which cannot be handled, i.e., SIGKILL and SIGSTOP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-10signal.c: directly enqueuenobu
* 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
2014-05-09* signal.c (trap): Return "SYSTEM_DEFAULT" if SIG_DFL is set.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-09signal.c: if to switchnobu
* signal.c (ruby_signal): turn multiple `if` statements into a `switch`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-09* signal.c (check_stack_overflow): Don't use ucontext_t if ucontext.hakr
is not available. Fixes build on Android (x86). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-04signal.c: check stack overflow by SPnobu
* 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
2014-03-31signal.c: preserve encodingnobu
* signal.c (esignal_init): preserve encoding in error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-27adjust indent and stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-27signal.c: static literal stringnobu
* signal.c (sigsegv): make message string static to suppress unnecessary copy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03signal.c: fault addressnobu
* 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
2013-11-21* eval_intern.h (SAVE_ROOT_JMPBUF): workaround for the failure ofusa
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
2013-10-26signal.c: adjust indentnobu
* signal.c (ruby_atomic_compare_and_swap): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-06signal.c: get rid of system namenobu
* 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
2013-09-12signal.c: adjust stylenobu
* signal.c (rb_sigaltstack_size, ruby_abort): adjust style, procnames-start-lines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-14signal.c: suppress a warningnobu
* signal.c (ruby_signal): suppress unused-value warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-12signal.c: for valgrindnobu
* signal.c (ruby_signal): suppress valgrind error in install_sighandler(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14* signal.c: need to include unistd.h for write(2).usa
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
2013-05-12* signal.c (rb_f_kill): fixes typo. s/HAS_KILLPG/HAVE_KILLPG/.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-09Fixed comment typo by @qqshfox [fix GH-279]hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-25envutil.rb: signal in Process::Statusnobu
* 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
2013-03-19* internal.h: added a declaration of ruby_kill().kosaki
* 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
2013-02-24signal.c: fix typenobu
* signal.c (sigsegv): type of write(2) is ssize_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-24* signal.c (sigsegv): suppress unused result warning. Becausekosaki
write(2) is marked __warn_unused_result__ on Linux glibc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-22* signal.c (ruby_abort): fix typo in r39354 [Bug #5014]ngoto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-21signal.c: extract check_stack_overflownobu
* signal.c (check_stack_overflow): extract duplicated code and get rid of declaration-after-statement. [Bug #5014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-21* signal.c (sigsegv): avoid to use async signal unsafe functionskosaki
when nested sigsegv is happen. [Bug #5014] [ruby-dev:44082] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23* thread.c: rename methods:ko1
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
2012-12-15* signal.c (rb_sigaltstack_size): cast sysconf() return valuekosaki
explicitly. Fix compile error on Mac OS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-15* signal.c (default_handler): remove rb_register_sigaltstack()kosaki
call. sigaltstack was already registered when creating threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-15* signal.c (rb_sigaltstack_size): new. calculate stack size forkosaki
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