aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_signal.rb
Commit message (Collapse)AuthorAgeFilesLines
* Signal.list deduplicates keysnormal2016-01-261-0/+6
| | | | | | | | | | 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
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | 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
* signal.c: nil for invalid signumnobu2015-03-021-0/+9
| | | | | | | * 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
* * test/lib/envutil.rb: Moved from test/ruby/.akr2014-11-131-1/+0
| | | | | | | | | | | | | | * 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
* signal.c: get rid of deadlock by discarded signalsnobu2014-10-071-0/+5
| | | | | | | | | * 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-0/+7
| | | | | | | * 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-0/+8
| | | | | | | | * 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
* test_signal.rb: remove stale testnobu2014-09-211-25/+0
| | | | | | | | * 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
* signal.c: EINVAL is a failurenobu2014-09-211-0/+8
| | | | | | | | * 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
* signal.c: preserve encodingnobu2014-07-301-0/+2
| | | | | | | * 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
* signal.c: directly enqueuenobu2014-05-101-0/+11
| | | | | | | * 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
* test_signal.rb: test iff SIGQUIT is supportednobu2014-05-101-1/+1
| | | | | | | * 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
* * signal.c (trap): Return "SYSTEM_DEFAULT" if SIG_DFL is set.akr2014-05-091-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_signal.rb: missing argvnobu2014-05-091-1/+1
| | | | | | * 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
* test_beginendblock.rb, test_signal.rb: run with default handlernobu2014-05-091-0/+3
| | | | | | | | | * 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
* signal.c: preserve encodingnobu2014-03-311-0/+1
| | | | | | * 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
* test/unit/assertions.rb: return exceptionnobu2013-10-091-3/+1
| | | | | | | | | * 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
* test_signal.rb: use standard fdsnobu2013-06-191-17/+13
| | | | | | | | * 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
* test_signal.rb: use SIGINT if needednobu2013-06-191-3/+4
| | | | | | | * 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
* test_signal.rb: use assert_in_out_errnobu2013-06-191-43/+15
| | | | | | | * 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
* test/ruby: reap zombiesnobu2013-06-191-3/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_signal.rb: extra quotesnobu2013-06-191-1/+1
| | | | | | | * 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
* thread.c: fix deadlocknobu2013-03-211-1/+7
| | | | | | | * 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
* * test/ruby/test_signal.rb (test_hup_me): skip if HUP isn't supported.shirosaki2013-03-201-0/+2
| | | | | | On Windows this test causes ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (test_hup_me): added a few comments.kosaki2013-03-191-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: added a declaration of ruby_kill().kosaki2013-03-191-0/+7
| | | | | | | | | | | | | | | | | | | | * 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
* * test/ruby/test_signal.rb (test_trap_puts): Fix typo. "sync"kosaki2013-01-311-1/+1
| | | | | | should be "STDOUT.sync". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (struct rb_mutex_struct): add allow_trap field.kosaki2012-11-281-0/+13
| | | | | | | | | | | | | | * 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
* * test/ruby/test_signal.rb (TestSignal#test_signame): fix windowskosaki2012-11-201-3/+3
| | | | | | | | | 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
* Don't send INT signal itself.naruse2012-11-201-11/+13
| | | | | | 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
* * signal.c (sig_signame): implements Signal.signame methodkosaki2012-11-191-0/+18
| | | | | | | | | | [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
* Revert r35622.naruse2012-05-111-1/+1
| | | | | | | | 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
* * thread.c (rb_threadptr_execute_interrupts_common): th->errinfo isnaruse2012-05-111-1/+1
| | | | | | | | | 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
* Embed backtrace to debug.naruse2012-05-031-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (reserved_signal_p): reverted a part of r32523.kosaki2011-07-121-6/+0
| | | | | | | | | | chikanaga noticed trap(:CHLD) has some realworld usecase. * test/ruby/test_signal.rb (TestSignal#test_reserved_signal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sig_trap): don't permit to change a signal handler whichkosaki2011-07-121-0/+25
| | | | | | | | | | | | | the interpreter reserved. * signal.c (reserved_signal_p): ditto. [Bug #2616] [ruby-core:27625] * test/ruby/test_signal.rb (TestSignal#test_reserved_signal): added a test for reserved signal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (TestSignal#test_signal_requiring): usenobu2011-06-171-5/+3
| | | | | | in-process signal to get rid of limitation of Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (TestSignal#test_signal_requiring):akr2011-06-011-1/+1
| | | | | | | redirect stderr to null device. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (TestSignal#test_signal_requiring):akr2011-05-311-0/+1
| | | | | | | initialize SIGINT handler. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (TestSignal#test_signal_requiring): don'takr2011-05-301-1/+1
| | | | | | | close stderr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (TestSignal#test_signal_requiring): smallusa2011-05-301-1/+1
| | | | | | | | but critical typo of r31642. sorry... [Bug #4798] [ruby-core:36550] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb (TestIO#test_ungetc2): get rid of busy loop.nobu2011-05-271-4/+4
| | | | | | * test/ruby/test_signal.rb (TestSignal#test_signal2): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (test_signal_requiring): skip on Windows.usa2011-05-191-0/+1
| | | | | | | we can send SIGINT only to pid 0 and the process itself. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (setup_exception): internal exception should be hiddennobu2011-05-181-0/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (TestSignal#test_signal_process_group):kosaki2011-05-151-0/+2
| | | | | | | | | skip if the platform doesn't have :pgroup capability. (i.e. skip if mswin32) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_f_kill): accept '-SIGXXX' style signal with Symbol ornagachika2011-05-151-0/+12
| | | | | | | | implicit convertion with #to_str. [ruby-dev:43169] fixes #4362 * test/ruby/test_signal.rb (test_signal_process_group): add a test for send signal to process group. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (TestSignal#test_exit_action): use spawnakr2010-08-091-3/+5
| | | | | | | instead of fork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): before cleanup, check signal buffer and runmame2010-04-271-1/+14
| | | | | | | | | handler if any. [ruby-core:20970] * thread.c (rb_threadptr_check_signal): separeted from timer_thread_function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Retry until the signal is trapped.naruse2009-10-181-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_signal.rb (TestSignal#test_exit_action): Threadkazu2008-10-241-1/+1
| | | | | | | may terminate before sysread. [ruby-dev:36835] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e