aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* process.c: simplify SIGCHLD-based waitpidnormal2018-08-273-152/+35
| | | | | | | | | | | | | | Introduce a new rb_thread_sleep_interruptible that does not execute interrupts before sleeping. Skipping the interrupt check before sleep is required for out-of-GVL ruby_waitpid_all to function properly when setting waitpid_state.ret Now that ubf_select can be called by the gvl.timer thread without recursive locking gvl.lock, we can safely use rb_threadptr_interrupt to deal with waking up sleeping processes, git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c: avoid lock ping-pong in do_gvl_timer & ubf_selectnormal2018-08-271-12/+10
| | | | | | | | | | | | | This simplifies the locking logic somewhat. While we're at it, designate_timer_thread is worthless in ubf_select because gvl_acquire_common already guarantees there is a gvl.timer if gvl->waitq is populated. In the future (for auto-fiber), this will allow using th->unblock.func for rb_waitpid callers (via rb_sigchld_handler). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-08-28svn2018-08-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* SC_TZNAME_MAX can also be infiniteeregon2018-08-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * append newline at EOF.svn2018-08-271-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/spec@007e908eregon2018-08-274-21/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * append newline at EOF.svn2018-08-271-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/spec@a89819deregon2018-08-273-4/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix template/fake.rb.in if ENV["RUBYOPT"] is nileregon2018-08-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix template/fake.rb.in when external and internal encodings are seteregon2018-08-271-2/+2
| | | | | | | * To be able to run spec/ruby/command_line/dash_encoding_spec.rb with the in-repo build. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * append newline at EOF.svn2018-08-272-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update to ruby/spec@09fa86ceregon2018-08-2754-106/+601
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Simplify guards, the behavior seems Linux-specificeregon2018-08-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2018-08-276-17/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge master branch from rubygems upstream.hsbt2018-08-2756-242/+868
| | | | | | | | * It's preparation to release RubyGems 3.0.0.beta2 and Ruby 2.6.0 preview 3. * https://github.com/rubygems/rubygems/compare/v3.0.0.beta1...fad2eb15a282b19dfcb4b48bc95b8b39ebb4511f git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hrtime.h: add note explaining current use of uint64_t [ci skip]normal2018-08-271-1/+2
| | | | | | [ruby-core:88678] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hrtime.h: missing parennobu2018-08-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hrtime.h: explicit casts to time_tnobu2018-08-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.ac: printf prifix for int64_tnobu2018-08-272-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: check interrupts explicitly in select/ppoll blocking regionsnormal2018-08-271-8/+15
| | | | | | | | | | | | The logic around blocking_region_begin is confusing to me, but the goal of this patch is to ensure rb_sigwait_fd_get and rb_sigwait_fd_put are matched. In other words, we don't want a thread to hold sigwait_fd forever if an exception is raised while calling select() or ppoll(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2018-08-270-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2018-08-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rdoc-6.1.0.beta1.hsbt2018-08-2722-194/+576
| | | | | | * https://github.com/ruby/rdoc/compare/v6.0.4...v6.1.0.beta1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2018-08-270-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-08-27svn2018-08-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge psych-3.1.0.pre1.hsbt2018-08-2716-130/+505
| | | | | | | | | * Update bundled libyaml-0.2.1 from 0.1.7. https://github.com/ruby/psych/pull/368 * Unify Psych's API: To use keyword arguments with method call. https://github.com/ruby/psych/pull/358 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb (test_recycled_fd_close): Linux workaroundnormal2018-08-261-0/+12
| | | | | | | | | | | | | Arch Linux CI still seems to timeout on this test... Note, I can't reproduce the failures in these tests on a FreeBSD 11.1 VM while infinite-looping, even without the "th.join(0.001)". It doesn't seem related to the use of rb_wait_for_single_fd (r64529). cf. https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-trunk/log/20180826T090003Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_sync.c: common wakeup_{one,all} implementationnormal2018-08-261-16/+11
| | | | | | | | | | | | | | | This let us avoid looping in rb_szqueue_max_set, saves us some lines of code and reduces binary size slightly (numbers from 32-bit x86): text data bss dec hex filename before: 91272 392 156 91820 166ac thread.o after: 91200 392 156 91748 16664 thread.o Inspiration from this taken from the FUTEX_WAKE op of the Linux futex(2) syscall. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: remove worthless waitpid_sys macronormal2018-08-261-8/+1
| | | | | | | | It is identical to do_waitpid, and the win32 version will not be needed for MJIT (since win32 does not suffer from the waitpid(-1, ...) conflict where waits can get stolen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/wait/test_io_wait_uncommon.rb: relax /dev/random checknormal2018-08-251-1/+7
| | | | | | | | | | Too many machines lack entropy to have a usable /dev/random. I had similar problems on my system until I started using haveged(8), but we can't require that for CI. cf. https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-trunk/log/20180825T213003Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c (ubf_wakeup_thread): `th' is never NULLnormal2018-08-251-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c: main thread always gets hit by signalsnormal2018-08-252-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-08-26svn2018-08-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: quiet down -Wmaybe-uninitialized on gcc 7.[2-3]normal2018-08-251-0/+9
| | | | | | Haven't tested gcc 8, yet; but gcc 6 seems fine.... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hrtime.h: add documentationnormal2018-08-252-1/+53
| | | | | | | | | I updated the patch with documentation but forgot about it, earlier :x [ruby-core:88616] [Misc #15014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2018-08-250-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: use rb_hrtime_t scalar for high-resolution time operationsnormal2018-08-256-235/+279
| | | | | | | | | | | | | | | | | | | | | Relying on "struct timespec" was too annoying API-wise and used more stack space. "double" was a bit wacky w.r.t rounding in the past, so now we'll switch to using a 64-bit type. Unsigned 64-bit integer is able to give us over nearly 585 years of range with nanoseconds. This range is good enough for the Linux kernel internal time representation, so it ought to be good enough for us. This reduces the stack usage of functions while GVL is held (and thus subject to marking) on x86-64 Linux (with ppoll): rb_wait_for_single_fd 120 => 104 do_select 120 => 88 [ruby-core:88582] [Misc #15014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* drb: close graceful shutdown pipe before socketnormal2018-08-252-0/+2
| | | | | | | | | Closing a listen socket while entering select(2) may trigger IOError or even deadlock because another thread may give the file descriptor to another file description; meaning the kernel can wait on the wrong description. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* drb: simplify shutdown pipe close logicnormal2018-08-251-9/+3
| | | | | | | IO#close is idempotent, so we don't need to waste bytecode to check or nil it at shutdown time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add AIX guardsnaruse2018-08-242-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb (test_recycled_fd_close): use IO#read to avoid ppoll callnormal2018-08-241-1/+1
| | | | | | | | IO#sysread calls rb_wait_for_single_fd for compatibility, and perhaps something is amiss with that (unrelated to timer-thread elimination) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-08-25svn2018-08-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c: use eventfd instead of pipe on Linuxnormal2018-08-243-11/+54
| | | | | | | | | | | Based on r64478, any regular user creating more than 1024 pipes on Linux will end up with tiny pipes with only a single page capacity. So avoid wasting user resources and use lighter eventfd on Linux. [ruby-core:88563] [Misc #15011] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/readline/extconf.rb: try using more readline APIsk0kubun2018-08-241-3/+3
| | | | | | | | | | on MinGW. [Bug #15020] From: MSP-Greg <Greg.mpls@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/readline/test_readline.rb: fix readline testk0kubun2018-08-232-7/+15
| | | | | | | | | | | | | for mingw. test/lib/minitest/unit.rb: Add 'guards' for mingw. Removed still-unused method `mswin?` from original patch. [Fix GH-1941] From: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c (ubf_timer_destroy): remove redundant getpid checknormal2018-08-231-10/+7
| | | | | | | TIMER_THREAD_CREATED_P already checks that pid, and glibc 2.25+ no longer caches getpid(2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-08-24svn2018-08-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NEWS: add entries for rb_waitpid and timer-thread [ci skip]normal2018-08-231-0/+4
| | | | | | | | Some of these changes may affect debugging and tracing tools [Bug #14867] [ruby-core:88199] [Misc #14937] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (rb_vm_encoded_insn_data_table_init): add a cast to build on clangmame2018-08-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Mention `--enable=jit` instead of `--jit`kazu2018-08-231-1/+1
| | | | | | | "--jit" flag usage may be deprecated at r63995 [Feature #14878] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e