Regardless of future features, this needs to work with
kqueue descriptors across platforms.
Today this will be useful for 3rd-party libraries using
kqueue. In the future, Ruby may use kqueue natively
and we shall ensure we can wait on it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c (rb_get_backtrace): check the result of `backtrace` even
if the method is redefined. [ruby-core:87013] [Bug #14756]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/irb/test_context.rb (TestInputMethod#initialize): fix typos
and increment `line_no` only when not reaching the end.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Commits in upstream repository since v2.1.0 can be found at:
https://github.com/ruby/openssl/compare/v2.1.0...v2.1.1
----------------------------------------------------------------
Kazuki Yamaguchi (7):
test/utils: disable Thread's report_on_exception in start_server
cipher: validate iterations argument for Cipher#pkcs5_keyivgen
extconf.rb: fix build with LibreSSL 2.7.0
test/test_pkey_rsa: fix test failure with OpenSSL 1.1.1
test/test_ssl_session: set client protocol version explicitly
Ruby/OpenSSL 2.0.8
Ruby/OpenSSL 2.1.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Thanks to ShockwaveNN (Pavel Lobashov) for reporting the bug.
[ruby-core:86990] [Bug #14750]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We need to ensure autoload declarations pointing to the same
feature (aka "file") can wait on each other to avoid deadlock
situations.
So, reorganize autoload data structures to maintain a
feature => autoload_data_i mapping, and have module constant
tables point to the new autoload_const struct instead of
directly to autoload_data_i. This allows multiple
autoload_const structs to refer to the SAME autoload_data_i
struct, and with it, the on-stack autoload_state.waitq.
The end result is different constants can share the same waitq
(tied to the feature name), and not deadlock each other during
loading.
Thanks to Eugene Kenny for the bug report and reproducible test case.
Reported-by: Eugene Kenny <elkenny@gmail.com>
* variable.c (autoload_featuremap): new global
(struct autoload_const): new per-const struct
(struct autoload_state): reference autoload_const instead of autoload_data_i
(struct autoload_data_i): remove per-const
(autoload_i_mark): delete from autoload_featuremap if unreferenced
(autoload_c_mark): new dmark callback
(autoload_c_free): new dfree callback
(autoload_c_memsize): new memsize callback
(autoload_const_type): new data type
(get_autoload_data): set autoload_const as well
(rb_autoload_str): use new data structures
(autoload_delete): cleanup from autoload_featuremap
(check_autoload_required): adjust for new internals
(rb_autoloading_value): ditto
(struct autoload_const_set_args): remove, redundant with autoload_const
(const_tbl_update): adjust for new internals
(autoload_const_set): ditto
(autoload_require): ditto
(autoload_reset): ditto
(rb_autoload_load): ditto
(rb_const_set): ditto
(current_autoload_data): ditto
(set_const_visibility): ditto
* test/ruby/test_autoload.rb (test_autoload_same_file): new test
(test_no_leak): new test
[ruby-core:86935] [Bug #14742]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
I can't reproduce the problem on my 32-bit machine, and I have
connectivity problems to my 64-bit systems at the moment.
Will revisit in a few hours hopefully.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We must not call normal Hash methods inside GC free callback,
either, however identity hash may be used.
[ruby-core:86935] [Bug #14742]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We need to ensure autoload declarations pointing to the same
feature (aka "file") can wait on each other to avoid deadlock
situations.
So, reorganize autoload data structures to maintain a
feature => autoload_data_i mapping, and have module constant
tables point to the new autoload_const struct instead of
directly to autoload_data_i. This allows multiple
autoload_const structs to refer to the SAME autoload_data_i
struct, and with it, the on-stack autoload_state.waitq.
The end result is different constants can share the same waitq
(tied to the feature name), and not deadlock each other during
loading.
Thanks to Eugene Kenny for the bug report and reproducible test case.
Reported-by: Eugene Kenny <elkenny@gmail.com>
* variable.c (autoload_featuremap): new global
(struct autoload_const): new per-const struct
(struct autoload_state): reference autoload_const instead of autoload_data_i
(struct autoload_data_i): remove per-const
(autoload_i_mark): delete from autoload_featuremap if unreferenced
(autoload_c_mark): new dmark callback
(autoload_c_free): new dfree callback
(autoload_c_memsize): new memsize callback
(autoload_const_type): new data type
(get_autoload_data): set autoload_const as well
(rb_autoload_str): use new data structures
(autoload_delete): cleanup from autoload_featuremap
(check_autoload_required): adjust for new internals
(rb_autoloading_value): ditto
(struct autoload_const_set_args): remove, redundant with autoload_const
(const_tbl_update): adjust for new internals
(autoload_const_set): ditto
(autoload_require): ditto
(autoload_reset): ditto
(rb_autoload_load): ditto
(rb_const_set): ditto
(current_autoload_data): ditto
(set_const_visibility): ditto
* test/ruby/test_autoload.rb (test_autoload_same_file): new test
[ruby-core:86935] [Bug #14742]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Revert "_mjit_compile_send.erb: inline recursive call"
I reverted r63360 in r63379, but the errors were reproductive from
r63350. So I need to revert this.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This reverts r63249 (revert r63212) and fixes a bug in it. The test to
prevent the bug is added as well.
vm_insnhelper.c: add `index` argument to vm_getivar. The argument is
created so that MJIT can pass the value of `cc->aux.index` on compilation
time. The cache invalidation in _mjit_compile_send_guard.erb is only
working for the cache value on compilation time.
Note: As `index` is always passed as constant and it's force-inlined,
the performance of `vm_getivar` won't be degraded in VM.
_mjit_compile_send_guard.erb: New. Used to invalidate inlined values of cc.
common.mk: update dependencies for _mjit_compile_send_guard.erb
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This reverts commit 6afea14043 r63328
I misread the original bug report and got results flipped.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c (rb_cstr_to_dbl_raise): do not ignore exponent part
when the input string longer than internal buffer contains
underscore(s). [ruby-core:86836] [Bug #14731]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The test works with make test-all, but I sometimes want to do a thing like:
`.ruby-svn/ruby -Itest/lib test/ruby/test_jit.rb -n test_clean_so`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
which has throw insn, not only ancestor iseqs of it.
I think we should remove catch_except_p flag and try to simplify the
catch table itself, to prevent similar bugs in the future.
test_jit.rb: add test to prevent the bug
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (internal_write_func, internal_writev_func): retry at
unexpected EPROTOTYPE on macOS, to get rid of a kernel bug.
[ruby-core:86690] [Bug #14713]
* ext/socket/init.c (rsock_{sendto,send,write}_blocking): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test_rubyoptions.rb: replace gsub with sub because it's suboptimal for
this
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
testing. 10s was long enough for my machine, but not for travis.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
testing. I'm running `make test-all RUN_OPTS='--jit-wait'` and the
read_timeout was too slow for it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* range.c (range_each): endless range begins with string-like
object should iterate from the converted result string, as well
as `#each` on a string-end range or `#step` method on an endless
range, i.e., `begin.succ` should not be called.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
It breaks backward compatibility than I thought. So it's disabled by
default. It means that REXML's XPath processor isn't compatible with
XPath 1.0. But it will be acceptable for users.
We can enable it by specifying "strict: true" to
REXML::XPathParser.new explicitly.
* lib/rexml/xpath.rb,
lib/rexml/xpath_parser.rb: Accept "strict: true" option.
* test/rexml/test_contrib.rb,
test/rexml/xpath/test_base.rb: Use not XPath 1.0 compatible behavior.
* test/rexml/test_jaxen.rb: Use XPath 1.0 compatible behavior.
* test/rss/test_1.0.rb,
test/rss/test_dublincore.rb,
spec/ruby/library/rexml/element/namespace_spec.rb,
spec/ruby/library/rexml/element/namespaces_spec.rb,
spec/ruby/library/rexml/element/prefixes_spec.rb: Enable again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (dlclose): use FreeLibrary to manage the reference count
on the loaded module properly.
* mjit.c (clean_so_file): clean shared object file after unloaded,
in-use files cannot be removed on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This reverts commit r63265.
ko1 said I should not have committed this! I'm sorry!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_profile_frames was always behaving as if the value given for the
start parameter was 0.
The reason for this was that it would check if (start > 0) { then
continue without updating the control frame pointer or anything other
than decrementing start.
[ruby-core:86147] [Bug #14607]
Co-authored-by: Dylan Thacker-Smith <Dylan.Smith@shopify.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63265 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
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
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
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
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
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
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
* range.c (range_step): FIXABLE + FIXABLE never overflow, but may
not be FIXABLE. [Feature #12912]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
lib/rexml/parsers/xpathparser.rb: Ignore white spaces in relative
location path.
test/rexml/xpath/test_base.rb: Add more test patterns and use more
debug friendly assertion style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/rexml/xpath/test_base.rb: Use constant value for the expected value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/rexml/xpath/test_base.rb: Expand loop assertion and stop to checking
just the first value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/rexml/xpath/test_base.rb: Stop to use separated assertions for
checking array value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Typical usages:
```
p ary[1..] # drop the first element; identical to ary[1..-1]
(1..).each {|n|...} # iterate forever from 1; identical to 1.step{...}
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_dump): get rid of an error on evaling with
frozen-string-literal enabled. [ruby-core:86539] [Bug #14687]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (str_undump): check for suffix before if Unicode escape
conflicts with it. the message "but used force_encoding" sounds
strange when it is not used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/irb.rb (eval_input): restore the last error `$!`, as the
previous result. [Feature #14684]
* lib/irb/context.rb (evaluate): add `exception` keyword argument
to set the last error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e