* lib/uri/common.rb (URI::HTML5ASCIIINCOMPAT): remove the constant
which has been unused since r40460, and wrong since r49069 due
to the operator precedence. [ruby-core:86678] [Bug #14711]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Transparent Huge Pages (THP) decrease the effectiveness of
CoW-friendly GC because it decreases page granularity. That is,
a forked process dirtying one bit of CoW-shared memory can
trigger a copy of a huge page (2MB on x86-64) instead of a smaller,
standard page (4K).
* eval.c (ruby_setup): disable THP on Linux
[ruby-core:86651] [Feature #14705]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (scan_once): fix the matched substring with `\K`, the
beginning of that string may differ from the matched position.
[ruby-core:86663] [Bug #14707]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/webrick/test_httpserver.rb (test_gigantic_request_header):
Errno::EPROTOTYPE is sometimes raised on Mac OS X 10.10.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
except test_jit.rb.
In some situations, this generates a wrong code. I'll add a test for it
later but let me revert this to make it work for now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (iseq_peephole_optimize): copy not only `leave`, with
a non-operand instruction, which are not longer than `jump`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (iseq_peephole_optimize): more eliminatable
instructions before `pop` without side effects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Maybe this fixes some CI failures. Also, use different timeouts
for each item for hopefully easier diagnosis.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c (Init_native_thread): fallback to the default
CLOCK_REALTIME when failed to set to CLOCK_MONOTONIC, e.g. on
Solaris. [Misc #14497]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Otherwise connections (commonly on IDLE, but it could be any
command) may never receive notifications of link errors.
[ruby-core:86628] [Feature #14703]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
r63236 (or r63237) introduces test failures and CI shows errors.
This commit makes skipping these tests. Please revert this commit
after tests (and rubyspec) work fine.
Failure log example:
https://gist.github.com/ko1/8456cf25fe35a696bd33ac86135092e4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
There's no reason to use CLOCK_REALTIME for any condvars in Ruby.
Indeed, we initialized all condvars with RB_CONDATTR_CLOCK_MONOTONIC
anyway; so simplify our code and reduce ifdefs.
[ruby-core:85639] [Misc #14497]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The position should be counted for each nodeset but the previous
implementation counts position for union-ed nodeset.
For example, "/a/*/*[1]" should be matched to "<c1/>" and "<c2/>" with
the following XML.
<a>
<b>
<c1/>
</b>
<b>
<c2/>
</b>
</a>
But the previous implementation just returns only "<c1/>".
* lib/rexml/element.rb (REXML::Attributes#each_attribute):
Support Enumerator for no block use.
* lib/rexml/element.rb (REXML::Attributes#each):
Support Enumerator for no block use.
* lib/rexml/functions.rb (REXML::Functions.string):
Support NaN again.
* lib/rexml/xpath_parser.rb: Re-implement "Step" evaluator.
It should evaluate "AxisSpecifier", "NodeTest" and "Predicate" in one
step to respect position for each nodeset.
* test/rexml/test_jaxen.rb: Enable more tests. Remained tests should
be also enabled but it'll not be near future.
* test/rexml/xpath/test_base.rb: Fix expected value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
It doesn't mean that all elements which name "ELEMENT_NAME" with any
namespace URI including null namespace URI. It means that all elements
which name "ELEMENT_NAME" with null namespace URI.
https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-NodeTest
> if the QName does not have a prefix, then the namespace URI is null
> (this is the same way attribute names are expanded).
We need to use "*[local-name()='#{ELEMENT_NAME}']" for all elements
which name "ELEMENT_NAME" with any namespace URI including null
namespace URI in XPath 1.0. But it's inconvenient. So this change
includes "*:#{LOCAL_NAME}" syntax support that is introduced since
XPath 2.0.
* lib/rexml/parsers/xpathparser.rb: Support "*:#{LOCAL_NAME}" syntax that
is introduced since XPath 2.0.
* lib/rexml/xpath_parser.rb:
* Fix namespace URI processing for "#{ELEMENT_NAME}". Now,
"#{ELEMENT_NAME}" doesn't accept elements with null namespace URI.
* Add "*:#{LOCAL_NAME}" support.
* test/rexml/test_contrib.rb,
test/rexml/test_core.rb,
test/rexml/xpath/test_base.rb: Follow this change.
* test/rexml/test_jaxen.rb: Fix namespace processing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Makefile.in (mjit_config.h): separate MJIT_ARCHFLAG for each
architecture on universal binary. cannot use precompiled-header
with multiple -arch options.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
I can't reproduce the problem myself, but gets loop seems ought
to give more useful information for tracking down where we're
stuck, at least.
Followup-to: r63217
cf. http://ci.rvm.jp/results/trunk-test@frontier/804284
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
in r63225. Not strictly needed but to avoid confusion.
The JIT compiler itself seems working fine.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* insns.def (checktype): split branchiftype to checktype and
branchif, to make branch condition negation possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/rexml/test_jaxen.rb: Fix wrong assert_raise usage. Note that this code
isn't used yet.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/rexml/xpath/test_base.rb: Use here document for readability.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
It is unsafe to release GVL and call rb_notify_fd_close after
close(2) on any given FD. FDs (file descriptor) may be recycled
in other threads immediately after close() to point to a different
file description. Note the distinction between "file description"
and "file descriptor".
th-1 | th-2
-------------------------------+---------------------------------------
io_close_fptr |
rb_notify_fd_close(fd) |
fptr_finalize_flush |
close(fd) |
rb_thread_schedule |
| fd reused (via pipe/open/socket/etc)
rb_notify_fd_close(fd) |
| sees "stream closed" exception
| for DIFFERENT file description
* thread.c (rb_thread_io_blocking_region): adjust comment for list_del
* thread.c (rb_notify_fd_close): give busy list to caller
* thread.c (rb_thread_fd_close): loop on busy list
* io.c (io_close_fptr): do not call rb_thread_fd_close on invalid FD
* io.c (io_reopen): use rb_thread_fd_close
Fixes: r57422 ("io.c: close before wait")
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Instead of maintaining linked-lists to store all
rb_queue/rb_szqueue/rb_condvar structs; store only a fork_gen
serial number to simplify management of these items.
This reduces initialization costs and avoids the up-front cost
of resetting all Queue/SizedQueue/ConditionVariable objects at
fork while saving 8 bytes per-structure on 64-bit. There are no
savings on 32-bit.
* thread.c (rb_thread_atfork_internal): remove rb_thread_sync_reset_all call
* thread_sync.c (rb_thread_sync_reset_all): remove
* thread_sync.c (queue_live): remove
* thread_sync.c (queue_free): remove
* thread_sync.c (struct rb_queue): s/live/fork_gen/
* thread_sync.c (queue_data_type): use default free
* thread_sync.c (queue_alloc): remove list_add
* thread_sync.c (queue_fork_check): new function
* thread_sync.c (queue_ptr): call queue_fork_check
* thread_sync.c (szqueue_free): remove
* thread_sync.c (szqueue_data_type): use default free
* thread_sync.c (szqueue_alloc): remove list_add
* thread_sync.c (szqueue_ptr): check fork_gen via queue_fork_check
* thread_sync.c (struct rb_condvar): s/live/fork_gen/
* thread_sync.c (condvar_free): remove
* thread_sync.c (cv_data_type): use default free
* thread_sync.c (condvar_ptr): check fork_gen
* thread_sync.c (condvar_alloc): remove list_add
[ruby-core:86316] [Bug #14634]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Instead of allocating and registering the altstack in different
places, do it together to reduce code and improve readability.
When thread cache is enabled, storing altstack in rb_thread_t
is wasteful and we may reuse altstack in the same pthread.
This also lets us clearly allow use of xmalloc to allow GC to
recover from ENOMEM.
[ruby-core:85621] [Feature #14487]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This is fairly non-intrusive bugfix to prevent children
from trying to reach into thread stacks of the parent.
I will probably reuse this idea and redo r62934, too
(same bug).
* vm_core.h (typedef struct rb_vm_struct): add fork_gen counter
* thread.c (rb_thread_atfork_internal): increment fork_gen
* variable.c (struct autoload_data_i): store fork_gen
* variable.c (check_autoload_data): remove (replaced with get_...)
* variable.c (get_autoload_data): check fork_gen when retrieving
* variable.c (check_autoload_required): use get_autoload_data
* variable.c (rb_autoloading_value): ditto
* variable.c (rb_autoload_p): ditto
* variable.c (current_autoload_data): ditto
* variable.c (autoload_reset): reset fork_gen, adjust indent
* variable.c (rb_autoload_load): set fork_gen when setting state
* test/ruby/test_autoload.rb (test_autoload_fork): new test
[ruby-core:86410] [Bug #14634]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e