We do not want to risk switching threads before going to sleep
because it can cause unexpected wakeups and put us in an
unexpected state when used with ConditionVariable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Where localhost is an alias but not the primary name of 127.0.0.1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Only Solaris 2.10 i386 and Windows seem to return 0 it and other
Solaris seem to fill the value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Happens when VALIDATE_SOCKLEN() actually checks the length such as on
FreeBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* I believe this should be default behavior, see [Feature #2250].
* Now make test-spec MSPECOPT='-R100 spec/ruby/library/socket' works fine.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* This reverts commit df9521fd043df1fb862e46f9b1af83223f16eb2d:
"Remove failing spec files"
* Platform guards follow in the next commits.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Having threads switch before we sleep can cause applications
to misread the state of the thread. Now, we are consistent
with blocking_region_begin behavior and change th->status
AFTER checking interrupts.
Maybe this can fix [Bug #15002]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* This reverts commit 647fc1227a4146ecbfeb0d59358abc8d99cd8ae6:
"thread_sync.c (rb_mutex_synchronize): only unlock if we own the mutex"
* Let's try to preserve the semantics of always being locked inside
Mutex#synchronize, even if an exception interrupts ConditionVariable#wait.
* As discussed on [Bug #14999].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NEWS: Converted to Markdown format, from (wrongly) Markdown-mixed
RDoc format.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Spurious interrupts from SIGCHLD cause Mutex#sleep (via
ConditionVariable#wait) to return early and breaks some use
cases. Since these are outside the programs's control with
MJIT, we will only consider pending interrupts (e.g. those
from Thread#run) and signals which cause a Ruby-level Signal.trap
handler to fire as "spurious" wakeups.
[ruby-core:88537] [Feature #15002]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
If an exception is raised inside Mutex#sleep (via ConditionVariable#wait),
we cannot guarantee we can own the mutex in the ensure callback.
However, who owns the mutex at that point does not matter. What
matters is the Mutex is usable after an exception occurs.
* thread_sync.c (rb_mutex_synchronize): only unlock if we own the mutex
* spec/ruby/library/conditionvariable/wait_spec.rb: only test lock
usability after thread kill. Who owns the lock at any
particular moment is an implementation detail which we cannot
easily guarantee.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This reverts commit d7ddbff295 (r64436)
Seems worthless at preventing CI failures
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Calling rb_mutex_sleep directly should avoid
thread-switching/interrupt checking which can lead to occasional
failures.
Unfortunately, this means overriding Mutex#sleep is no longer
supported. Will let this commit run for a bit see if CI failures
from ConditionVariable specs continue...
cf. https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu/ruby-trunk/log/20180817T213003Z.fail.html.gz
[ruby-core:88524] [Bug #14999]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
According to some runs in mjit-test (make test-all RUN_OPTS="--jit-wait"),
this test might not be the cause of its failure.
So, let me try running this again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
I gave up to introduce the optimization that skips pc motion by checking
C code's line number. The same code can often be shared by multiple
program counters and it's so hard to achieve the optimization in MJIT's
architecture.
Reverting to improve performance by removing -g1 and to remove so file
when it becomes not necessary.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* This reverts commit 325fd38901.
* Platform guards in the next commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (ruby_waitpid_all): nothing to do unless SIGCHLD is
available.
* signal.c (ruby_nocldwait): used only if SIGCHLD is available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This is not called in signal handlers, so there's no reason for
it. glibc 2.25+ no longer caches getpid(), so it will cost a
syscall for those users.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e