summaryrefslogtreecommitdiff
path: root/test/ruby/test_signal.rb
AgeCommit message (Collapse)Author
2023-03-15Remove SIGCHLD `waidpid`. (#7527)Samuel Williams
* Remove `waitpid_lock` and related code. * Remove un-necessary test. * Remove `rb_thread_sleep_interruptible` dead code. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-03-14Revert SIGCHLD changes to diagnose CI failures. (#7517)Samuel Williams
* Revert "Remove special handling of `SIGCHLD`. (#7482)" This reverts commit 44a0711eab7fbc71ac2c8ff489d8c53e97a8fe75. * Revert "Remove prototypes for functions that are no longer used. (#7497)" This reverts commit 4dce12bead3bfd91fd80b5e7195f7f540ffffacb. * Revert "Remove SIGCHLD `waidpid`. (#7476)" This reverts commit 1658e7d96696a656d9bd0a0c84c82cde86914ba2. * Fix change to rjit variable name. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-03-09Remove SIGCHLD `waidpid`. (#7476)Samuel Williams
* Remove `waitpid_lock` and related code. * Remove un-necessary test. * Remove `rb_thread_sleep_interruptible` dead code. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-01-19Do not create core file if it is intentional abortKoichi Sasada
Two tests abort intentionally and they create core files if possible. In these case, we don't need to see core files so disable by `"Process.setrlimit(Process::RLIMIT_CORE, 0)` for those cases. Notes: Merged: https://github.com/ruby/ruby/pull/5466
2022-01-04Use omit instead of skip: test/ruby/**/*.rbHiroshi SHIBATA
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-06-30Wait for the helper thread to terminateNobuyoshi Nakada
2019-06-28Removed unused variablesNobuyoshi Nakada
2018-08-25thread_pthread.c: main thread always gets hit by signalsnormal
We need to ensure Signal.trap handlers can function if the main thread is sleeping after a subthread has grabbed sigwait_fd, but later exited. Consider the following timeline: main_thread sub-thread ----------------------------------------- Signal.trap() { ... } get sigwait_fd ppoll on sigwait_fd native_cond_sleep (via pthread_cond_wait) ppoll times-out put sigwait_fd sub-thread exits only thread alive SIGNAL HITS The problem is pthread_cond_wait cannot return EINTR, so we can never run the Signal.trap handler. So we will avoid using native_cond_sleep in the main thread and always use ppoll to sleep when in the main thread. This can guarantee the main thread remains aware of signals; even if it cannot safely read off sigwait_fd git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-13test/ruby/test_signal.rb (test_sigchld_ignore): increase timeoutnormal
I suspect CI test machine was overloaded at the time, or swapping at the time due to parallel build with mjit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08test/ruby/test_signal.rb: skip ensure if test is skippednormal
Thanks to Greg for the fix. [ruby-core:87860] [Bug #14867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08signal.c: preserve trap(:CHLD, "IGNORE") behavior with SIGCHLDnormal
We need to preserve "IGNORE" behavior from Ruby 2.5 and earlier. We can't rely on SA_NOCLDWAIT any more, since we always need system() and MJIT to work; so we fake that behavior using dedicated reaper (currently in timer-thread). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-03test/ruby/test_signal.rb: speedup some test by disabling RubyGemsnormal
test_signame_delivered is reduced from 1.0s to 0.1s git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-10signal.c: refine error messagesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-10signal.c: check NUL bytesnobu
* signal.c (trap_signm): check NUL bytes explicitly before raising "unsupported signal" ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-06test_signal.rb: fix arguments ordernobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-12remove ruby_kill() introduced for [Bug #7951].ko1
* thread.c (rbuy_kill): removed. This function is used with SIGSEGV, SIGBUS, SIGKILL, SIGILL, SIGFPE and SIGSTOP and these signals are affect immediately. So that `kill(2)' is enough for them. * signal.c (rb_f_kill): ditto. * vm_core.h (rb_thread_t::interrupt_cond): removed because only `ruby_kill()' uses this field. * test/ruby/test_signal.rb: Without this patch sending SIGSTOP to own process wait another interrupt even if another process sends SIGCONT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-26Signal.list deduplicates keysnormal
This allows us to reuse string objects used in symbols as well as any string representations of signal names in source code. * signal.c (sig_list): use fstring for hash key * test/ruby/test_signal.rb (test_signal_list_dedupe_keys): added git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02signal.c: nil for invalid signumnobu
* 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
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-07signal.c: get rid of deadlock by discarded signalsnobu
* 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
2014-10-06signal.c: send signal unless handlednobu
* 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
2014-09-21signal.c: SIGEXIT is not a system signalnobu
* 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
2014-09-21test_signal.rb: remove stale testnobu
* test/ruby/test_signal.rb (TestSignal#test_trap_system_default): remove stale test. signals are delivered to the main thread always now, so sleep in sub thread is no longer interrupted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-21signal.c: EINVAL is a failurenobu
* 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
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-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-10test_signal.rb: test iff SIGQUIT is supportednobu
* test/ruby/test_signal.rb (test_trap_system_default): test only if SIGQUIT is supported, which is platform dependent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45897 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-09test_signal.rb: missing argvnobu
* test/ruby/test_signal.rb (test_hup_me): add missing argv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-09test_beginendblock.rb, test_signal.rb: run with default handlernobu
* test/ruby/test_beginendblock.rb (test_propagate_signaled): run with default handler. * test/ruby/test_signal.rb (test_hup_me): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45891 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
2013-10-09test/unit/assertions.rb: return exceptionnobu
* lib/test/unit/assertions.rb (assert_raise_with_message): return raised exception same as assert_raise. * test/ruby, test/-ext-: use assert_raise_with_message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19test_signal.rb: use standard fdsnobu
* test/ruby/test_signal.rb (test_exit_action): use IO.popen and standard file descriptors instead of fd 3 and 4, which is not available on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19test_signal.rb: use SIGINT if needednobu
* test/ruby/test_signal.rb (test_kill_immediately_before_termination): use SIGINT if SIGUSR1 is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19test_signal.rb: use assert_in_out_errnobu
* test/ruby/test_signal.rb (test_kill_immediately_before_termination): use assert_in_out_err instead of separated fork and assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19test/ruby: reap zombiesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19test_signal.rb: extra quotesnobu
* test/ruby/test_signal.rb (TestSignal#test_signal_process_group): remove extra quotes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-21thread.c: fix deadlocknobu
* thread.c (ruby_kill): get rid of deadlock on signal 0. [ruby-dev:47182] [Bug #8137] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-20* test/ruby/test_signal.rb (test_hup_me): skip if HUP isn't supported.shirosaki
On Windows this test causes ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-19* test/ruby/test_signal.rb (test_hup_me): added a few comments.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39829 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-01-31* test/ruby/test_signal.rb (test_trap_puts): Fix typo. "sync"kosaki
should be "STDOUT.sync". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-28* thread.c (struct rb_mutex_struct): add allow_trap field.kosaki
* internal.h (rb_mutex_allow_trap): added. * thread.c (rb_mutex_lock, rb_mutex_unlock): check mutex->allow_trap. * thread.c (mutex_sleep): remove trap check because it uses rb_mutex_lock and rb_mutex_unlock internally. * thread.c (rb_mutex_allow_trap): new helper function for the above. * io.c (io_binwrite): mark fptr->write_lock as writable in trap. * test/ruby/test_signal.rb (test_trap_puts): test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-20* test/ruby/test_signal.rb (TestSignal#test_signame): fix windowskosaki
test failure. Process.kill on windows can't send a signal to another process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-20Don't send INT signal itself.naruse
On make test-all, it kills the process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-19* signal.c (sig_signame): implements Signal.signame methodkosaki
[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
2012-05-11Revert r35622.naruse
It breaks bootstraptest/test_exception.rb:388. "* thread.c (rb_threadptr_execute_interrupts_common): th->errinfo is" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-11* thread.c (rb_threadptr_execute_interrupts_common): th->errinfo isnaruse
not Fixnum, but exception object. This causes test_signal_requiring of test/ruby/test_signal.rb fail if the sub process is killed on waiting IO in lex_io_gets in require itself, not sleep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e