summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-08-18thread.c (sleep_*): check interrupt before changing th->statusnormal
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
2018-08-18Revert r64441eregon
* 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
2018-08-18Temporary revert "process.c: dead code when no SIGCHLD"naruse
This reverts commit r64407. Maybe it breaks http://mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20180817T095734Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18NEWS: quote false [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18NEWS: converted to Markdown [ci skip]nobu
* 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
2018-08-18thread.c (sleep_*): reduce the effect of spurious interruptsnormal
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
2018-08-18[DOC] Fix indent [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18thread_sync.c (rb_mutex_synchronize): only unlock if we own the mutexnormal
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
2018-08-18Revert "thread_sync.c (do_sleep): avoid thread-switch/interrupt check"normal
This reverts commit d7ddbff2954ba22b71bdfeba4b94e1c4fb91efb0 (r64436) Seems worthless at preventing CI failures git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18thread_sync.c (do_sleep): avoid thread-switch/interrupt checknormal
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
2018-08-18Suppress read of ~/.irbrckazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18test/ruby/test_system.rb: suppress prompt and echo on Windowsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18test/lib/zombie_hunter.rb: enable zombie hunter for MJITk0kubun
I think this issue is solved by Eric Wong. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18test_function.rb: try running test_nogvl_poll againk0kubun
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
2018-08-18tool/downloader.rb: retry 500 from GitHubk0kubun
Unfortunately, GitHub may return 500 for temporary failure: https://travis-ci.org/ruby/ruby/builds/417246523 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18mjit_worker.c: revert r64322 and r64323k0kubun
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
2018-08-17* 2018-08-18svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Guard spec failing on Solariseregon
* https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20180817T182406Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Add guard for Solaris in Socket#connect_nonblock speceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Guard connect_nonblock spec on FreeBSDeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Guard with a :pktinfo feature specs relying on PKTINFOeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Re-add specseregon
* This reverts commit 325fd389018897bd156837639675517ef3b7dea5. * Platform guards in the next commit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Add a note how to run specs under older Ruby versionseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Fix typo in version guarderegon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Add version guards for Enumerator::ArithmeticSequenceeregon
* And keep specs for older versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17spec/README.md: add a note about version guardseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Integrate new specs for ConditionVariable#wait to prevent regressionseregon
* See [Bug #14999]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17NEWS: clarify that we still use FD_CLOEXEC [ci skip]normal
[Misc #14907] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17process.c: dead code when no SIGCHLDnobu
* 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
2018-08-17[DOC] Add ticket number [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17[DOC] Update NEWS about close_others [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17vm.c: add a simple rdoc for RubyVMmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17thread_pthread.c (rb_sigwait_fd_get): skip getpid checknormal
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
2018-08-17signal.c: no SIGCHLD, no sigchld_hitnobu
* signal.c (sigchld_hit): if SIGCHLD is not available, this variable never sets. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17ast.c (rb_ast_node_type): return frozen stringsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17passing non-stdio fds is not supported on Windowsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16process.c: defaults to close_others falsenormal
Arbitrarily closing file descriptors on exec breaks use cases where a Ruby process sets up a descriptor for non-Ruby children to use. For example, the "rake foo" target may spawn any number of subprocesses (Ruby or not) which depends on parsing the "FOO" environment variable for out_fd:99 and writing to foo.out FOO=out_fd:99 rake foo 99>>foo.out Unfortunately, this introduced one incompatibility in test/lib/test/unit.rb and it now requires explicitly setting IO#close_on_exec=true [ruby-core:88007] [Misc #14907] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16thread_sync.c (rb_mutex_lock): acquire lock before being killednormal
We (the thread acquiring the mutex) need to acquire the mutex before being killed to work with ConditionVariable#wait. Thus we reinstate the acquire-immediately-after-sleeping logic from pre-r63711 while still retaining the acquire-after-checking-for-interrupts logic from r63711. This regression was introduced in commit 501069b8a4013f2e3fdde35c50e9527ef0061963 (r63711) ("thread_sync.c (rb_mutex_lock): fix deadlock") for [Bug #14841] [ruby-core:88503] [Bug #14999] [Bug #14841] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16Makefile.sub: remove -DRUBY_EXPORT overridden by -U optionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16* 2018-08-17svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16appveyor.yml: run on all branchesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16Remove outdated comment [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16skip examples failing on solarisnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16configure.ac: LIBPATHENV on macOSnobu
* configure.ac (LIBPATHENV): use DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH on macOS, to honor runtime paths embedded in the binaries. [ruby-core:88487] [Bug #14992] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16Makefile.in: dependencies to config.statusnobu
* Makefile.in (ruby.pc, ruby-runner.h): fix missing dependencies. config.status is needed to be up to date, to run it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16thread.c (consume_communication_pipe): disarm UBF_TIMER before consumenormal
Same reasoning as the disarm in rb_sigwait_fd_get, the current thread is already processing signals, so we do not need UBF_TIMER to continually kick the process, anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16thread_pthread.c: reduce ubf_timer arming for non-signal wakeupsnormal
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-16thread_pthread.c: check signals from gvl.timernormal
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-16test/net/imap/test_imap.rb (test_exception_during_idle): kill infinite loopernormal
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* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e