aboutsummaryrefslogtreecommitdiffstats
path: root/signal.c
Commit message (Collapse)AuthorAgeFilesLines
* signal.c: nil for invalid signumnobu2015-03-021-0/+1
| | | | | | | * signal.c (sig_signame): return nil if the argument is a valid signal number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: preserve errnonormal2015-02-251-0/+4
| | | | | | | | * signal.c (sighandler): preserve errno Patch by Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca> [ruby-core:68172] [Bug #10866] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c: static IDsnobu2015-02-231-2/+5
| | | | | | | * eval.c (ruby_static_id_signo, ruby_static_id_status): add static IDs, signo and status. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: SIGBUS by stack overflow on Funtoonobu2015-02-011-1/+2
| | | | | | | * signal.c (sigbus): seems that Funtoo Linux also delivers SIGBUS at stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: fix received_signalnobu2014-12-221-3/+8
| | | | | | | * signal.c (received_signal): fix condition to define. [ruby-core:67032] [Bug #10629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: clear received signal at stack overflownobu2014-12-211-2/+4
| | | | | | | * signal.c (check_stack_overflow): clear the received reserved signal before raising stack overflow but not aborting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (ruby_signal): since SIGKILL is not supported by MSVCRT,usa2014-12-181-0/+11
| | | | | | | | should be treated before calling signal(2). [Bug #10615] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: include ucontext.hnobu2014-12-131-0/+3
| | | | | | * signal.c: include ucontext.h for ucontext_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: stack overflow on FreeBSDnobu2014-12-131-1/+9
| | | | | | | * signal.c (check_stack_overflow): check sp also on i386/x86_64 FreeBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: rb_cv_mcontext_t_ptrnobu2014-12-131-2/+1
| | | | | | | * configure.in (rb_cv_mcontext_t_ptr): abstract whether mcontext_t is a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: Gather declarations in non-header files.akr2014-11-181-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: Include ruby.h and ruby/encoding.h to beakr2014-11-151-2/+1
| | | | | | | | includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: signal list to killnobu2014-11-101-0/+2
| | | | | | | * signal.c (rb_f_kill): [DOC] mention known signal list. [ruby-core:66162] [Bug #10492] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: avoid repeated disable/enable interruptnormal2014-10-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | We only install system-level signal handlers during init (before any threads or user code is running), so there's no need to repeatedly enable/disable the interrupts at that time. We also do not change system-level sig handlers once user-level code is running. This saves about 20 syscalls at startup and makes the executable smaller (numbers from 32-bit x86): text data bss dec hex filename before: 2815726 12100 30552 2858378 2b9d8a ruby after: 2815022 12100 30552 2857674 2b9aca ruby * signal.c (install_sighandler): remove rb_disable_interrupt and rb_enable_interrupt calls (init_sigchld): ditto (Init_signal): disable and enable interrupt once around all install_sighandler and init_sigchld to reduce syscalls at start [Feature #9345] [ruby-core:59480] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (check_reserved_signal_): fix write count since r47991.kazu2014-10-241-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: adjust indent of preprocessing directivesnobu2014-10-191-22/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: use writevnobu2014-10-171-3/+23
| | | | | | | * signal.c (check_reserved_signal): print messages by writev() if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: exclude terminatorsnobu2014-10-171-2/+3
| | | | | | | * signal.c (check_reserved_signal): exclude terminator in literal strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: get rid of heap corruptionnobu2014-10-161-1/+1
| | | | | | | | * signal.c (rb_sigaltstack_size): double default size to get rid of heap corruption by alternate stack overflow in SEGV handler. typically happened at fprintf() in control_frame_dump(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: abort if nesting reserved signalnobu2014-10-161-9/+39
| | | | | | | * signal.c (check_reserved_signal): abort if reserved signal received in reserved signal handlers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Allow failure of sighandler installation on NativeClient.yugui2014-10-111-2/+6
| | | | | | | * signal.c (install_signalhandler, init_sigchld): allow failure because it always fails with ENOSYS on NaCl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: get rid of deadlock by discarded signalsnobu2014-10-071-1/+2
| | | | | | | | | * signal.c (rb_f_kill): get rid of deadlock as unhandled and discarded signals do not make interrupt_cond signaled. based on the patch by Kazuki Tsujimoto at [ruby-dev:48606]. [Bug #9820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: send signal unless handlednobu2014-10-061-3/+12
| | | | | | | * signal.c (rb_f_kill): should not ignore signal unless the default handler is registered. [ruby-dev:48592] [Bug #9820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: SIGEXIT is not a system signalnobu2014-09-211-2/+7
| | | | | | | | * signal.c (trap): SIGEXIT is not a system signal and is dealt with internally, so it should not try to register the system signal handler by sigaction. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: raise SystemCallError for all failuresnobu2014-09-211-9/+10
| | | | | | | | | | | | * signal.c (ruby_signal): return SIG_ERR as well as signal(2). * signal.c (trap): raise SystemCallError for all failures when called as a method. * signal.c (Init_signal): fail by [BUG] only if initialization is failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: EINVAL is a failurenobu2014-09-211-9/+19
| | | | | | | | * signal.c (ruby_signal): although "EINVAL from sigaction(2) is not a bug", but even it is a failure. pointed at toRuby/guRuby in RubyHiroba. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: remvoe ruby_disable_gc_stress and add ruby_disable_gcko12014-09-091-2/+2
| | | | | | | | | | 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
* * signal.c (ruby_signal): Don't set SA_SIGINFO for SIG_IGN andakr2014-09-051-2/+8
| | | | | | | | SIG_DFL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: preserve encodingnobu2014-07-301-10/+13
| | | | | | | * 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
* get rid of function calls in RSTRING_PTRnobu2014-07-301-3/+6
| | | | | | | | | | | | * 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
* * process.c (rlimit_resource_type, rlimit_resource_value):ktsj2014-07-301-3/+3
| | | | | | | | | | | | | | 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
* symbols instead of IDsnobu2014-07-281-1/+1
| | | | | | | | | | | | | | | | | * 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
* revert r46834 because it does not pass testsko12014-07-161-18/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: remove rb_vm_t::trap_list[RUBY_NSIG], but addko12014-07-161-9/+18
| | | | | | | | | | | | | 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
* Init functions don't need ID cachesnobu2014-07-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: drop dangerous tagnobu2014-06-231-0/+6
| | | | | | | | * 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
* signal.c: no cfunc frame at stack overflownobu2014-06-221-2/+3
| | | | | | | * 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
* constify parametersnobu2014-06-181-1/+1
| | | | | | | | * 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
* signal.c: return proper membernobu2014-05-291-1/+4
| | | | | | | | | * 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
* signal: remove window for SignalException on IGNOREnormal2014-05-281-1/+13
| | | | | | | | | * 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
* signal.c: revert part of r46100nobu2014-05-251-1/+1
| | | | | | | | * 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
* report bug with machine regisitersnobu2014-05-251-2/+4
| | | | | | | | | | * 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
* signal.c: fix stack overflow check on Mac OS Xnobu2014-05-251-4/+5
| | | | | | | | * 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
* signal.c: use mcontext_tnobu2014-05-181-1/+1
| | | | | | | * 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 by SPnobu2014-05-181-5/+17
| | | | | | | | * 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 the next page toonobu2014-05-121-2/+10
| | | | | | | | * 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: directly deliver non-handlable signalsnobu2014-05-111-0/+6
| | | | | | | * 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
* signal.c: directly enqueuenobu2014-05-101-3/+57
| | | | | | | * 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 (trap): Return "SYSTEM_DEFAULT" if SIG_DFL is set.akr2014-05-091-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: if to switchnobu2014-05-091-5/+9
| | | | | | | * 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