Граф коммитов

51709 Коммитов

Автор SHA1 Сообщение Дата
normal 3872ea814c thread_pthread.c: reduce ubf_timer arming for non-signal wakeups
We do not need to rely on SIGVTALRM for non-sighandler wakeups.
This will reduce spurious wakeups in cases where sigwait_fd
is not grabbed again, soon.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16 08:26:56 +00:00
normal 960ef493a4 thread_pthread.c: check signals from gvl.timer
For (rare) blocking functions which are not affected by signals,
we need to call the appropriate unblocking function via
`threadptr_trap_interrupt'

While we're at it, handling waitpid/SIGCHLD from gvl.timer isn't
harmful, here.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16 08:26:51 +00:00
normal 0783fd9366 test/net/imap/test_imap.rb (test_exception_during_idle): kill infinite looper
It is possible for Mutex#sleep (via ConditionVariable#wait)
to prematurely wake up under MJIT (because Mutex#sleep can't
handle spurious wakeups).  This affects @idle_done_cond in
Net::IMAP#idle and means the response handler may never
set `in_idle' to `true`.

In any case, ensure the infinite looping `raiser' thread
stops running when the test is done.

Will work on reducing the effect of spurious wakeups from
MJIT...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16 03:37:14 +00:00
svn 6fc7f10309 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16 00:58:22 +00:00
nobu 7d6a26f2a1 Adding Enumerator::Lazy#uniq and Enumerator::Lazy#grep_v to proc chaining
[Feature #14994]

[Fix GH-1930]

From: Anmol Chopra <chopraanmol1@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16 00:58:21 +00:00
nobu 2c195f64cf enumerator.c: id_lazy is no longer used since r38923
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16 00:13:47 +00:00
nobu bb8b44b078 apply r64239 to macOS too
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16 00:05:08 +00:00
svn 490898a0d1 * 2018-08-16
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 18:56:35 +00:00
normal 309042d8c1 test/ripper/test_parser_events.rb (test_block_variables): bump RLIMIT_AS again
I still seem to need more memory for parallel tests with MJIT...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 18:56:34 +00:00
akr 3d3ff9f324 gmtimew_noleapsecond uses tables for mon and mday.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 14:24:44 +00:00
nobu 50ad099590 spec/ruby/optional/capi/ext/io_spec.c: guard unreachable code
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 12:53:45 +00:00
nobu 9071cd6393 spec/ruby/optional/capi/ext/io_spec.c: guard unreachable code
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 11:01:30 +00:00
normal 4610d36c4c thread_pthread.c: hoist out do_gvl_timer and improve documentation
This hopefully clarifies the roles of UBF_TIMER and vm->gvl.timer

[ruby-core:88475] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 07:16:55 +00:00
normal 727a2d55a3 vm_core.h (rb_thread_t): pack small fields together
On a 64-bit system, this reduces rb_thread_t from 536 to 520 bytes.
Depending on the allocation, this can reduce cacheline access
for checking the abort_on_exception, report_on_exception and
pending_interrupt_queue_checked flags.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 05:54:41 +00:00
normal 906ad1670a thread_pthread.h (native_thread_data): split list_node between ubf and gvl
Do not waste extra memory for each thread, but make
thread_pthread.c easier-to-follow as a result.

[ruby-core:88475] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 05:31:31 +00:00
k0kubun 7815d7d713 test_function.rb: skip running test
that times out with test-all w/ --jit-wait.

I'm running the following command on Wecker CI everyday:
```
make test-all TESTOPTS="--color=never --job-status=normal" RUN_OPTS="--disable-gems --jit-wait --jit-warnings" RUBY_FORCE_TEST_JIT=1
```

By running yesterday's all commits, r64354 ran successfully but r64355
didn't. So the test should be fixed to run with --jit-wait at first.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 04:51:10 +00:00
normal 3dcf85e08e thread_pthread.c: rename rb_timer_* to ubf_timer_*
These functions will not be exported outside of thread_pthread.c
and we need to clarify the timer here is used for ubf and not
timeslice.

[ruby-core:88475] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 04:32:46 +00:00
normal e4fd71d64d thread_pthread.c: rename timer_thread_pipe to signal_self_pipe
This data structure has nothing to do with timers or threads.

[ruby-core:88475] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 04:32:41 +00:00
normal 5dca7d86b9 thread_pthread.c: additional UBF_TIMER == UBF_TIMER_PTHREAD guards
Hopefully this makes the code easier-to-follow

[ruby-core:88475] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 04:32:36 +00:00
nobu 425a820d17 appveyor.yml: no MSYS path conversion
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 04:10:19 +00:00
k0kubun 4940bbc791 test_readline.rb: skip teardown failure
https://ci.appveyor.com/project/ruby/ruby/build/9271/job/e88212s136mr0dgr

I'll take a look at MSP-Greg's patch on readline later.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 03:03:18 +00:00
nobu 5a149052fe appveyor.yml: get rid of msys sh as possible
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 02:15:13 +00:00
nobu 438955efde -Wsuggest-attribute=noreturn on io_spec_rb_io_wait_readable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 02:05:20 +00:00
k0kubun 36e41fd950 test_env.rb: change mingw branch
e287cb7391/patches/gte20600/test-ruby-test_env.rb_test_huge_value.patch

From: MSP-Greg (Greg L) <Greg.mpls@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 01:55:09 +00:00
k0kubun 0c95c744ce skip tests failing on AppVeyor MinGW
Let me skip this to make CI green first and take a look later...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 01:40:57 +00:00
k0kubun 1684a1bd71 appveyor.yml: remove broken --name option
Currently all tests are skipped by the --name option.
V=1 is for debugging this issue.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 23:23:44 +00:00
normal ab7e34e4db webrick/httpauth/htgroup.rb (flush): avoid unnecessary unlink
Based on patch by akr [ruby-core:88477], use Tempfile.create
to avoid unnecessary unlink call.  Unlike akr's original patch,
this does not change the return value of flush.

Thanks-to: Tanaka Akira <akr@fsij.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 23:00:02 +00:00
normal 7d664ecc49 Revert "test/lib/leakchecker.rb (find_tempfiles): don't warn for missing files"
This reverts commit 52102f6ff5 (r64238).

It is no longer necessary if we use Tempfile.create in
WEBrick::HTTPAuth::Htgroup#flush (see next commit)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 22:59:57 +00:00
normal 635294038b Revert "thread_pthread.c: use UBF_TIMER_PTHREAD on Solaris"
This reverts commit 31bfe0fe86 (r64357)

commit 17ed23bb6d (r64359,
"fix fragile spec from unpredictable errno") is the correct fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 22:06:40 +00:00
svn 81562d8954 * 2018-08-15
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 17:07:37 +00:00
normal 17ed23bb6d spec/ruby/optional/capi/io_spec.rb: fix fragile spec from unpredictable errno
rb_io_wait_readable and rb_io_wait_writable depend on the TSD
errno value.  Due to the recent changes in r64352-r64353 to
restructure GVL, errno could be set to EAGAIN from the signal
self-pipe and cause the rb_io_wait_readable spec to block
unexpectedly.  This should fix rubyspec timeouts on Solaris:

  http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180814T042506Z.fail.html.gz

* spec/ruby/optional/capi/ext/io_spec.c: add errno= setter method
* spec/ruby/optional/capi/io_spec.rb: set errno to appropriate values for tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 17:07:36 +00:00
nobu 37279d1546 non-symbol keys in kwargs
* class.c (separate_symbol): [EXPERIMENTAL] non-symbol key in keyword
  arguments hash causes an exception now.
  c.f. https://twitter.com/yukihiro_matz/status/1022287578995646464

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 11:58:17 +00:00
normal 31bfe0fe86 thread_pthread.c: use UBF_TIMER_PTHREAD on Solaris
I'm not sure what's causing this failure in Solaris and only
on rubyspec, since rb_io_wait_readable is a well-exercised
code path in other places.  But maybe using a pthread for
timing (similar to old timer-thread) can solve the issue.

cf. http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180814T042506Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 06:49:25 +00:00
normal 291afc96bd thread_pthread.c: use CLOCK_REALTIME on SunOS (Solaris)
timer_create does not seem to support CLOCK_MONOTONIC on Solaris,
and CLOCK_HIRES seems like it could fail with insufficient permissions:

https://docs.oracle.com/cd/E86824_01/html/E54766/timer-create-3c.html

(Only tested on Linux and FreeBSD)

[ruby-core:88360] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 02:24:37 +00:00
normal 1e769ce6ed test/fiddle/test_function.rb (test_nogvl_poll): stop timer hack
EINTR seems unavoidable in real programs (or MJIT), so maybe
it's not worth dealing with.  r64353 relies on POSIX timers
to signal.

Switching pipes and sockets to non-blocking by default would let
us get rid of POSIX timers, timer pthread and this hack:
https://bugs.ruby-lang.org/issues/14968

[ruby-core:88360] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 00:31:31 +00:00
normal 8da12db13d thread_pthread (rb_timer_arm): ignore UBF_TIMER_POSIX state 2
It looks like I forgot to account for a situation involving 3
threads.

[ruby-core:88360] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 22:19:54 +00:00
normal 3dd6288d73 thread_pthread: use POSIX timer or thread to get rid of races
This closes race condition where GVL is uncontended and a thread
receives a signal immediately before calling the blocking
function when releasing GVL:

	1) check interrupts
	2) release GVL
	3) blocking function

If signal fires after 1) but before 3), that thread may never
wake up if GVL is uncontended

We also need to wakeup the ubf_list unconditionally on
gvl_yield; because two threads can be yielding to each other
while waiting on IO#close while waiting on threads in IO#read or
IO#gets.

[ruby-core:88360] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 21:34:24 +00:00
normal 48b6bd74e2 thread_pthread.c: eliminate timer thread by restructuring GVL
This reverts commit 194a6a2c68 (r64203).

Race conditions which caused the original reversion will be fixed
in the subsequent commit.

[ruby-core:88360] [Misc #14937]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 21:34:20 +00:00
naruse 4d2e0fffb0 FreeBSD 11.0 lacks ELFCOMPRESS_ZLIB
FreeBSD 11.0 unfortunately lacks ELF compression definitions in their
elf.h (sys/elf_common.h), and 11.1 introduced them.
b9167d33a1

Though we can add workaround, we simply drop support because
FreeBSD 11.0 is already EOL at November 30, 2017.
https://www.freebsd.org/security/unsupported.html

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 19:12:23 +00:00
k0kubun 490838959b appveyor.yml: install gdbm
which is missing on AppVeyor environment

6a1e323ae8 (commitcomment-30056791)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 16:03:47 +00:00
svn 2d313a29f8 * 2018-08-14
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 15:29:41 +00:00
k0kubun 6a1e323ae8 appveyor.yml: add MinGW build
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 15:29:40 +00:00
kazu 7d2b70a95f fix typos [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 14:54:32 +00:00
usa 4e87ee8da8 mention about r64337
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 14:33:06 +00:00
usa f0d20684d2 Add some tests for *method_defined?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 14:29:21 +00:00
kazu 0381ec5164 Fix test bug
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 13:50:48 +00:00
usa 67d87b192b Fix problem about notimplemented case
Re-revert r64340, and take care about notimplemented case.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 13:48:27 +00:00
k0kubun 7496672904 appveyor.yml: drop unnecessary 1.0. prefix
from version.

Also I fixed the wrong way of using `for:`.
Specifying `for` without `matrix.only` was just useless.
This fix is for adding MinGW matrix in the future.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 13:46:06 +00:00
kazu 984ba3da62 Add test for method_defined?(notimplement)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 13:27:49 +00:00
kazu ee05c56752 Revert "Support optional inherit argument for Module#method_defined?"
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 13:27:47 +00:00