summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2022-04-12Fix dtoa buffer overrunv3_0_4nagachika
2022-04-12Just free compiled pattern if no space is usednagachika
2022-04-12Merge RubyGems-3.2.33Hiroshi SHIBATA
2022-03-13merge revision(s) 496591de96b261b8789332c7f8b2bfbd17658955: [Backport #18578]nagachika
st.c: Do not clear entries_bound when calling Hash#shift for empty hash tab->entries_bound is used to check if the bins are full in rebuild_table_if_necessary. Hash#shift against an empty hash assigned 0 to tab->entries_bound, but didn't clear the bins. Thus, the table is not rebuilt even when the bins are full. Attempting to add a new element into full-bin hash gets stuck. This change stops clearing tab->entries_bound in Hash#shift. [Bug #18578] --- st.c | 1 - test/ruby/test_hash.rb | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
2022-03-13merge revision(s) c79d2e54748f52c5023b0a1ee441561df9826c17: [Backport #18562]nagachika
Fix TAG_THROW through require [Bug #18562] Previously this was being incorrectly swapped with TAG_RAISE in the next line. This would end up checking the T_IMEMO throw_data to the exception handling (which calls Module#===). This happened to not break existing tests because Module#=== returned false when klass is NULL. This commit handles throw from require correctly by jumping to the tag retaining the TAG_THROW state. --- load.c | 2 +- test/ruby/test_exception.rb | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-)
2022-03-13merge revision(s) b555e659c4974acc423083b71b1bd5ec6a926046: [Backport #18388]nagachika
Do not use `fcopyfile` if appending to non-empty file [Bug #18388] `fcopyfile` appends `src` to `to` and then truncates `to` to it's original size. --- io.c | 7 +++++++ test/ruby/test_io.rb | 12 ++++++++++++ 2 files changed, 19 insertions(+)
2022-03-13merge revision(s) ↵nagachika
7ff1bf317887c0d7b21e91ad548d07b9f05c540c,e89d80702bd98a8276243a7fcaa2a158b3bfb659: [Backport #18516] An alias can suppress method redefinition warning --- test/ruby/test_alias.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) Fix memory leak at the same named alias [Bug #18516] When aliasing a method to the same name method, set a separate bit flag on that method definition, instead of the reference count increment. Although this kind of alias has no actual effect at runtime, is used as the hack to suppress the method re-definition warning. --- method.h | 1 + test/ruby/test_alias.rb | 18 ++++++++++++++++++ vm_method.c | 9 ++++++++- 3 files changed, 27 insertions(+), 1 deletion(-)
2022-03-13merge revision(s) ↵nagachika
5c7af72304d0ad33cd3f21b24a4bc44e8acd5b2c,d650b17686d49c2ce8e6a87039861154e93d4621: [Backport #18497] Assuming EXIT_SUCCESS equals 0 is not portable --- test/ruby/test_fiber.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) `rb_fiber_terminate` must not return [Bug #18497] In a forked process from a fiber, the fiber becomes the only fiber, `fiber_switch` does nothing as there is no other fibers, `rb_fiber_terminate` does not terminate the fiber. In that case, reaches the end of `fiber_entry` finaly, which is declared as "COROUTINE" and should never return. --- cont.c | 3 ++- eval_intern.h | 2 +- test/fiber/test_process.rb | 15 +++++++++++++++ test/ruby/test_fiber.rb | 5 +++++ 4 files changed, 23 insertions(+), 2 deletions(-)
2022-03-13merge revision(s) ae5458f228a5477383e9c00425d85d50a3867817: [Backport #18475]nagachika
thread.c: Convert TAG_BREAK to a normal exception at thread top-level [Bug #18475] --- test/ruby/test_enum.rb | 11 +++++++++++ thread.c | 3 +++ 2 files changed, 14 insertions(+)
2022-03-12merge revision(s) 9e0a91d0640600f2dfd7fc1d5fae6667019c9ca5: [Backport #18458]nagachika
Don't segfault if Warning.warn is undefined Check that there is a method entry for the method before passing it to rb_method_entry_arity. Fixes [Bug #18458] --- error.c | 3 ++- test/ruby/test_exception.rb | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
2022-03-12merge revision(s) fdf39963490cf2cf95b30d91bb9b35964c2c2350: [Backport #18421]nagachika
Empty and return the buffer if zero size is given [Bug #18421] In `IO#readpartial` and `IO#read_nonblock`, as well as `IO#read`. --- io.c | 8 ++++++-- test/ruby/test_io.rb | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-)
2022-03-12merge revision(s) ↵nagachika
d6c5a30cfdf658280338dbb8c8b17fab3190b928,a2d4e1cda68a49980a4f9f353f400efbde7e7884: [Backport #18392] ObjectSpace::WeakMap#inspect: check if living object [Bug #18392] --- gc.c | 29 +++++++++++++++++++++++------ test/ruby/test_weakmap.rb | 9 +++++++++ 2 files changed, 32 insertions(+), 6 deletions(-) Fixed the check order in wmap_live_p [Bug #18392] Check if the object is a pointer to heap before check the flag in that object. --- gc.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-)
2022-02-19merge revision(s) c51b92c18deb850d2cea3a7c9020db23b364ab72: [Backport #18358]nagachika
[ruby/zlib] [Bug #18358] Fix crash in zlib when in progress When Zlib::Inflate#inflate or Zlib::Deflate#deflate is called recursively inside the block, a crash can occur because of an use-after-free bug. https://github.com/ruby/zlib/commit/50fb8a0338 --- ext/zlib/zlib.c | 117 ++++++++++++++++++++++++++++++++----------------- test/zlib/test_zlib.rb | 10 ++++- 2 files changed, 85 insertions(+), 42 deletions(-)
2022-02-19merge revision(s) b3d62a77d928eff01268ca7fa1c1c0966702926d: [Backport #17803]nagachika
[ruby/zlib] Synchronize access to zstream to prevent segfault in multithreaded use I'm not sure whether this handles all multithreaded use cases, but this handles the example that crashes almost immediately and does 10,000,000 total deflates using 100 separate threads. To prevent the tests from taking forever, the committed test for this uses only 10,000 deflates across 10 separate threads, which still causes a segfault in the previous implementation almost immediately. Fixes [Bug #17803] https://github.com/ruby/zlib/commit/4b1023b3f2 --- ext/zlib/zlib.c | 33 ++++++++++++++++++++++++++- test/zlib/test_zlib.rb | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-)
2022-02-19merge revision(s) ↵nagachika
cf831f49189c4a890da6845e39199a5dfaf4fb48,3260602fa3d905ba310b9afbc5365ee52cb53d62: zlib: fix Gzip{Writer,Reader}.new fails with a O_TMPFILE file --- ext/zlib/zlib.c | 18 ++++++++++++++---- test/zlib/test_zlib.rb | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) Adjusted indents [ci skip] --- ext/zlib/zlib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
2022-02-13skip some test using openssl to cease failure on GitHub Actions for MinGW.nagachika
2022-02-13skip some tests of rdoc temporary.nagachika
2022-02-13merge revision(s) ↵nagachika
f18a0b7654d471101b207e7fe553e12a25398e45,77e1b477297a48e285d34b21e8d30ab4b46bf90c,c483aa8394fc26e341666db66938b1d6fc2cbb8e,f2e39e5fed498b51ae914ed42ec51ae578330583,6aaa1c4d09249baae93d5bb7fba585be420c4fee,923b3652247aa17ac99dc45cb1cd0654fa08d976,950c7a12efa19d73bed10d377368a50664cae32c,69ce9e4187589335124077029496ee293d4e9189,ddb87396349fa4699153d5c4c7569c2e0186adfc,09e7a0c4a4fba18e3308e4f8cb4b8b5b52b41d20,298d65b1e4f3019af7fc9b905390b56736f5fd0e,2f3edf28f3a251bac2cf3b47b46b372faac71e8e: [ruby/rdoc] Follow-up rubygems Use test-unit assertions instead of minitest. https://github.com/ruby/rdoc/commit/d6a6209d7f --- test/rdoc/test_rdoc_rubygems_hook.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) [ruby/rdoc] Add an alias for test-unit with older versions of RubyGems https://github.com/ruby/rdoc/commit/b8d68fdd87 --- test/rdoc/test_rdoc_rubygems_hook.rb | 3 +++ 1 file changed, 3 insertions(+) [ruby/rdoc] Rwrite test-case for rubygems_hook without Gem::TestCase https://github.com/ruby/rdoc/commit/f8d1087ce5 --- test/rdoc/test_rdoc_rubygems_hook.rb | 38 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) [ruby/rdoc] Update test/rdoc/test_rdoc_rubygems_hook.rb https://github.com/ruby/rdoc/commit/fb264c4cc4 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> --- test/rdoc/test_rdoc_rubygems_hook.rb | 4 ++++ 1 file changed, 4 insertions(+) [ruby/rdoc] Use pend instead of skip https://github.com/ruby/rdoc/commit/8460a36d84 --- test/rdoc/test_rdoc_rubygems_hook.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) Close UserInteraction for tests to fix leaked file descriptors --- test/rdoc/test_rdoc_rubygems_hook.rb | 2 ++ 1 file changed, 2 insertions(+) Make temporary directory under the regular location --- test/rdoc/test_rdoc_rubygems_hook.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) Clear default configurations Remove environment variables which can affect the default configurations. --- test/rdoc/test_rdoc_rubygems_hook.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) Clear rdoc options in the global rubygems configuration --- test/rdoc/test_rdoc_rubygems_hook.rb | 2 ++ 1 file changed, 2 insertions(+) Dispose the global rubygems configuration wholely --- test/rdoc/test_rdoc_rubygems_hook.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Discard RDOCOPT environment variable to make tests stable --- test/rdoc/test_rdoc_rubygems_hook.rb | 1 + 1 file changed, 1 insertion(+) [ruby/rdoc] Prefer omit to pend These conditions are not temporary, rather platform dependent. https://github.com/ruby/rdoc/pull/815#discussion_r654660411 https://github.com/ruby/rdoc/commit/92545fa250 --- test/rdoc/test_rdoc_rubygems_hook.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
2021-12-24merge revision(s) ↵nagachika
fb4cf204a662a8cd9dafef6f31f2bd0db9129abe,fa0279d947c3962c3f8c32852278d3ebb964cb19: [Backport #17725] use me->def instead of me for opt_table `vm_opt_method_table` is me=>bop table to manage the optimized methods (by specialized instruction). However, `me` can be invalidated to invalidate the method cache entry. [Bug #17725] To solve the issue, use `me-def` instead of `me` which simply copied at invalidation timing. A test by @jeremyevans https://github.com/ruby/ruby/pull/4376 --- test/ruby/test_method.rb | 15 +++++++++++++++ vm.c | 11 +++++------ 2 files changed, 20 insertions(+), 6 deletions(-) should not share same `def` for specialized method Because the key of redefine table is `def`, `def` should be unique for each optimized method (`alias` is not allowed). --- array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2021-12-02merge revision(s) 44d67128a827c65d1a3867c5d8fd190d10aa1dd2:nagachika
test/openssl/test_cipher: skip AES-CCM tests on OpenSSL <= 1.1.1b AES CCM mode in OpenSSL <= 1.1.1b was overly strict in the parameters assignment order. This has been relaxed by OpenSSL 1.1.1c. https://github.com/openssl/openssl/commit/b48e3be947ddc5da6b5a86db8341081c72b9a4ee The test case is failing on Ubuntu 18.04 because it still uses the initial 1.1.1 release and has the issue: http://rubyci.s3.amazonaws.com/graviton2/ruby-master/log/20210316T120003Z.fail.html.gz --- test/openssl/test_cipher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2021-11-24 Fix integer overflowv3_0_3nagachika
Make use of the check in rb_alloc_tmp_buffer2. https://hackerone.com/reports/1328463 When parsing cookies, only decode the values Bump version Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
2021-11-24Merge date-3.1.3Hiroshi SHIBATA
2021-11-24Merge RubyGems-3.2.32 and Bundler-2.2.32Hiroshi SHIBATA
2021-11-24merge revision(s) ↵nagachika
f367b4ffe739453e87e55f955138b0ce662942b7,31a757a4426f1ac8c479313e01542940386fc2fe,837cbea64b74d464bfbfb10e6c81a8f92c6eee71: assert_equal accepts an expected value as the first argument --- test/psych/test_coder.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) Make the test pass with the old libyaml I have no idea what result is right, but it fails with libyaml 0.1.7 (bundled with Ubuntu 18.04) anyway. --- test/psych/test_coder.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) test/psych/test_coder.rb: Suppress non-parenthesis warnings http://rubyci.s3.amazonaws.com/debian9/ruby-master/log/20210518T093002Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20210518T093002Z/ruby/test/psych/test_coder.rb:277: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator ``` --- test/psych/test_coder.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
2021-11-23merge revision(s) ↵nagachika
5680c38c75aeb5cbd219aafa8eb48c315f287d97,f5d20411386ff2552ff27661387ddc4bae1ebc30: [Backport #17573] Use valid `ec` for postponed job. Postponed job can be registered from non-Ruby thread, which means `ec` in TLS can be NULL. In this case, use main thread's `ec` instead. See https://github.com/ruby/ruby/pull/4108 and https://github.com/ruby/ruby/pull/4336 --- vm_trace.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) Avoid assert failure when NULL EC is expected After 5680c38c75aeb5cbd219aafa8eb48c315f287d97, postponed job APIs now expect to be called on native threads not managed by Ruby and handles getting a NULL execution context. However, in debug builds the change runs into an assertion failure with GET_EC() which asserts that EC is non-NULL. Avoid the assertion failure by passing `false` for `expect_ec` instead as the intention is to handle when there is no EC. Add a test from John Crepezzi and John Hawthorn to exercise this situation. See GH-4108 See GH-5094 [Bug #17573] Co-authored-by: John Hawthorn <john@hawthorn.email> Co-authored-by: John Crepezzi <john.crepezzi@gmail.com> --- ext/-test-/postponed_job/postponed_job.c | 31 ++++++++++++++++++++++++++ test/-ext-/postponed_job/test_postponed_job.rb | 7 ++++++ vm_trace.c | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-)
2021-11-23merge revision(s) e83c02a768af61cd0890a75e90bcae1119d8bd93: [Backport #18289]nagachika
Delegate keywords from Enumerable#to_a to #each Fixes [Bug #18289] --- enum.c | 2 +- test/ruby/test_enum.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
2021-11-23merge revision(s) 84202963c52e02cecad3e6b2fad478bfbeee1bc7: [Backport #18329]nagachika
[Bug #18329] Fix crash when calling non-existent super method The cme is NULL when a method does not exist, so check it before accessing the callcache. --- test/ruby/test_super.rb | 31 +++++++++++++++++++++++++++++++ vm_insnhelper.c | 3 ++- 2 files changed, 33 insertions(+), 1 deletion(-)
2021-11-22Bump psych version to 3.3.2Hiroshi SHIBATA
2021-11-22Bump strscan version to 3.0.1Hiroshi SHIBATA
2021-11-22Bump etc version to 1.3.0Hiroshi SHIBATA
2021-11-22Bump io-wait version to 0.2.0Hiroshi SHIBATA
2021-11-22Bump fiddle version to 1.0.8Hiroshi SHIBATA
2021-11-22Bump rinda version to 0.1.1Hiroshi SHIBATA
2021-11-22Bump stringio version to 3.0.1Hiroshi SHIBATA
2021-11-22Bump optparse version to 0.1.1Hiroshi SHIBATA
2021-11-22Merge RubyGems 3.2.31 and Bundler 2.2.31Hiroshi SHIBATA
2021-11-22Merge RubyGems 3.2.30 and Bundler 2.2.30Hiroshi SHIBATA
2021-11-22Merge RubyGems 3.2.29 and Bundler 2.2.29Hiroshi SHIBATA
2021-11-22Merge RubyGems 3.2.28 and Bundler 2.2.28Hiroshi SHIBATA
2021-11-22Merge RubyGems 3.2.27 and Bundler 2.2.27Hiroshi SHIBATA
2021-11-06merge revision(s) d0a05fd4b40ff0f88728c4897e67b68185128f54:nagachika
Fixed FD leaks --- test/socket/test_tcp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2021-11-06merge revision(s) a4d5ee4f31bf3ff36c1a8c8fe3cda16aa1016b12: [Backport #18264]nagachika
[Bug #18264] Fix memory leak in TracePoint TracePoint leaks memory because it allocates a `rb_tp_t` struct without ever freeing it (it is created with `RUBY_TYPED_NEVER_FREE`). --- test/ruby/test_settracefunc.rb | 10 ++++++++++ vm_trace.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
2021-10-31test_gc.rb: relax criterionnagachika
2021-10-30openssl: import v2.2.1Kazuki Yamaguchi
Bring the local copy of ruby/openssl in sync with the upstream gem release v2.2.1. The commits happened in the upstream repository can be found at: https://github.com/ruby/openssl/compare/v2.2.0...v2.2.1 Note that many of these have already been applied to ruby.git and don't appear in the file changes of this commit.
2021-10-16merge revision(s) 217df51f0e5d9824ed712a4d175f555d932e44d8: [Backport #18232]nagachika
Dump outer variables tables when dumping an iseq to binary This commit dumps the outer variables table when dumping an iseq to binary. This fixes a case where Ractors aren't able to tell what outer variables belong to a lambda after the lambda is loaded via ISeq.load_from_binary [Bug #18232] [ruby-core:105504] --- compile.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++- test/ruby/test_iseq.rb | 10 +++++++++ 2 files changed, 64 insertions(+), 1 deletion(-)
2021-10-09merge revision(s) abc0304cb28cb9dcc3476993bc487884c139fd11: [Backport #17507]nagachika
Avoid race condition in Regexp#match In certain conditions, Regexp#match could return a MatchData with missing captures. This seems to require at the least, multiple threads calling a method that calls the same block/proc/lambda which calls Regexp#match. The race condition happens because the MatchData is passed from indirectly via the backref, and other threads can modify the backref. Fix the issue by: 1. Not reusing the existing MatchData from the backref, and always allocating a new MatchData. 2. Passing the MatchData directly to the caller using a VALUE*, instead of indirectly through the backref. It's likely that variants of this issue exist for other Regexp methods. Anywhere that MatchData is passed implicitly through the backref is probably vulnerable to this issue. Fixes [Bug #17507] --- re.c | 46 +++++++++++++++++++--------------------------- test/ruby/test_regexp.rb | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+), 27 deletions(-)
2021-10-09merge revision(s) ↵nagachika
60d0421ca861944459f52292d65dbf0ece26e38a,b6534691a16d751d59fc572d5dddebcaeb21f007,409dbc951b9875d27bd73748c88e15386473cffb,842b0008c132dd587f09766a228041afb7fed24f: [Backport #18191] Fix the encoding of loaded feature names [Bug #18191] The feature names loaded from the default load paths should also be in the file system encoding. --- ruby.c | 12 +++++++++++- test/ruby/test_require.rb | 22 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) Copy path strings as interned strings --- ruby.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) Replace expanded load path only when modified --- ruby.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Skip broken strings as the locale encoding --- internal/string.h | 1 + ruby.c | 11 +++++++---- string.c | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-)
2021-10-09merge revision(s) ↵nagachika
89242279e61b023a81c58065c62a82de8829d0b3,529fc204af84f825f98f83c34b004acbaa802615: [Backport #18141] Marshal.load: do not call the proc until strings have their encoding Ref: https://bugs.ruby-lang.org/issues/18141 --- marshal.c | 7 +++- spec/ruby/core/marshal/shared/load.rb | 62 +++++++++++++++++++++++------------ test/ruby/test_marshal.rb | 17 ++++++++++ 3 files changed, 64 insertions(+), 22 deletions(-) marshal.c: don't call the proc with partially initialized objects. (#4866) For cyclic objects, it requires to keep a st_table of the partially initialized objects. --- marshal.c | 75 ++++++++++++++++++++--------------- spec/ruby/core/marshal/shared/load.rb | 75 ++++++++++++++++++++--------------- test/ruby/test_marshal.rb | 12 ++++++ 3 files changed, 97 insertions(+), 65 deletions(-)
2021-10-03merge revision(s) ↵nagachika
7c0230b05d0978958f89434c84ddd9c82419c1a5,552728a23aeab0df598b356b19a573259e297d14,49af9012a20a824542cf588e55e5488895553e09: [Backport #18184] Check the entire name as `ruby2_keywords_flag` [Bug #18184] --- marshal.c | 2 +- test/ruby/test_marshal.rb | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) Check the encoding of `ruby2_keywords_flag` [Bug #18184] --- marshal.c | 1 + test/ruby/test_marshal.rb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) Prohibit invalid encoding symbols [Bug #18184] --- marshal.c | 8 +++++++- test/ruby/test_marshal.rb | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-)
2021-10-03merge revision(s) ddb32e66160ab50849419ef7c7ac584913b79c34: [Backport #18173]nagachika
[Bug #18173] Update loaded_features_index If $LOADED_FEATURES is changed in the just required file, also the index table needs to be updated before loaded_features_snapshot is reset. If the snapshot is reset without updating the table, the name of the added feature will not be found. --- load.c | 1 + test/ruby/test_require.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+)