14176 Commits

Author SHA1 Message Date
Hiroshi SHIBATA
bd9424c71c Merge StringIO 3.0.1.1 2024-04-23 16:03:15 +09:00
Hiroshi SHIBATA
7957a25edf Merge RDoc-6.3.4.1 2024-04-23 16:02:50 +09:00
Hiroshi SHIBATA
616926b55e
CVE-2023-36617 for Ruby 3.0 (#7997)
* Merge URI-0.10.3

* Merge URI-0.10.0.3 for Bundler
2023-06-29 13:25:17 +00:00
Hiroshi SHIBATA
53a7cee685 Merge Time-0.1.1 2023-03-30 19:49:08 +09:00
Hiroshi SHIBATA
2d99ef4f74
Merge URI-0.10.2 for Ruby 3.0 (#7607)
* Merge URI-0.10.2

* Merge URI-0.10.0.2 for bundler

* Added assert_linear_performance for URI tests
2023-03-29 05:54:14 +00:00
Nobuyoshi Nakada
998fe8ace4 Historical timezones of Lisbon in tzdata are unstable 2023-03-29 10:57:57 +09:00
Takashi Kokubun
4527440b52 Skip test_europe_lisbon on macOS
until we figure out why it's failing.
2023-03-29 10:57:57 +09:00
NAKAMURA Usaku
a0a9918557 merge revision(s) 58cc3c9f: [Backport #19187]
[Bug #19187] Fix for tzdata-2022g

	---
	 test/ruby/test_time_tz.rb | 21 +++++++++++++++------
	 1 file changed, 15 insertions(+), 6 deletions(-)
2022-12-08 12:31:20 +09:00
Nobuyoshi Nakada
5fb3cf463c Keep GC disabled until VM bootstrap has done [Bug #17583] 2022-11-24 20:01:26 +09:00
nagachika
3ff3855be2 merge revision(s) dae843f6b7502f921a7e66f39e3714a39d860181,86096a91d55f72620e0f8ca8634da5fa342dc35b:
Bypass git submodule add/update with git config
	 protocol.file.allow=always option.

	Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
	---
	 test/rubygems/test_gem_source_git.rb | 5 +++++
	 1 file changed, 5 insertions(+)

	[rubygems/rubygems] Use [] instead of double-quotes

	---
	 test/rubygems/test_gem_source_git.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
2022-11-24 11:21:28 +09:00
Hiroshi SHIBATA
cbe2c0cd09 Merge CGI-0.2.2 2022-11-24 11:21:28 +09:00
NAKAMURA Usaku
6ac4449fce merge revision(s) 7f81f335478a3ca873f34e3bc0af6927819d3e84: [Backport #18734]
Return `false` where sticky-bit is not provided [Bug #18734]

	---
	 file.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
2022-06-18 23:00:21 +09:00
NAKAMURA Usaku
28b238f2cb merge revision(s): a0040af6715d85f416f1282588974e151a8164eb
[Win32] Fix mode of character/pipe device stat [Bug #18732]
2022-06-18 22:54:12 +09:00
nagachika
3fa771dded Fix dtoa buffer overrun 2022-04-12 20:48:55 +09:00
nagachika
052ec6d258 Just free compiled pattern if no space is used 2022-04-12 20:48:55 +09:00
Hiroshi SHIBATA
48be8051ef Merge RubyGems-3.2.33 2022-04-12 14:07:25 +09:00
nagachika
f404b21f84 merge revision(s) 496591de96b261b8789332c7f8b2bfbd17658955: [Backport #18578]
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-13 15:42:14 +09:00
nagachika
0bd3e436e2 merge revision(s) c79d2e54748f52c5023b0a1ee441561df9826c17: [Backport #18562]
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-13 15:16:29 +09:00
nagachika
f4f0c793f6 merge revision(s) b555e659c4974acc423083b71b1bd5ec6a926046: [Backport #18388]
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-13 15:10:34 +09:00
nagachika
6175823bab merge revision(s) 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-13 11:52:53 +09:00
nagachika
6a8c166498 merge revision(s) 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-13 11:47:39 +09:00
nagachika
42b1e87ba7 merge revision(s) ae5458f228a5477383e9c00425d85d50a3867817: [Backport #18475]
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-13 11:37:03 +09:00
nagachika
e18e6af604 merge revision(s) 9e0a91d0640600f2dfd7fc1d5fae6667019c9ca5: [Backport #18458]
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-12 16:53:37 +09:00
nagachika
7c05379063 merge revision(s) fdf39963490cf2cf95b30d91bb9b35964c2c2350: [Backport #18421]
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-12 16:30:52 +09:00
nagachika
f2d996dcff merge revision(s) 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-03-12 16:28:26 +09:00
nagachika
951e1377c1 merge revision(s) c51b92c18deb850d2cea3a7c9020db23b364ab72: [Backport #18358]
[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-19 15:15:04 +09:00
nagachika
49ed412060 merge revision(s) b3d62a77d928eff01268ca7fa1c1c0966702926d: [Backport #17803]
[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-19 14:36:41 +09:00
nagachika
ebbe2fc923 merge revision(s) 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-19 14:33:05 +09:00
nagachika
7cd359261e skip some test using openssl to cease failure on GitHub Actions for MinGW. 2022-02-13 17:02:39 +09:00
nagachika
b61b456391 skip some tests of rdoc temporary. 2022-02-13 16:09:00 +09:00
nagachika
6c70a32918 merge revision(s) 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(-)
2022-02-13 16:05:27 +09:00
nagachika
545d682071 merge revision(s) 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-24 17:47:44 +09:00
nagachika
5c5974dbd0 merge revision(s) 44d67128a827c65d1a3867c5d8fd190d10aa1dd2:
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.

	b48e3be947

	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-12-02 08:03:28 +09:00
nagachika
3fb7d2cadc Fix integer overflow
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-24 20:12:15 +09:00
Hiroshi SHIBATA
d1e3dd4db1 Merge date-3.1.3 2021-11-24 19:46:22 +09:00
Hiroshi SHIBATA
c2125240cc Merge RubyGems-3.2.32 and Bundler-2.2.32 2021-11-24 19:46:22 +09:00
nagachika
3ac499555d merge revision(s) 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-24 19:21:54 +09:00
nagachika
949af69408 merge revision(s) 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-23 14:52:30 +09:00
nagachika
aadb8cad56 merge revision(s) e83c02a768af61cd0890a75e90bcae1119d8bd93: [Backport #18289]
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-23 14:52:30 +09:00
nagachika
b6f87d527f merge revision(s) 84202963c52e02cecad3e6b2fad478bfbeee1bc7: [Backport #18329]
[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-23 14:52:29 +09:00
Hiroshi SHIBATA
5afefe4371 Bump psych version to 3.3.2 2021-11-22 10:51:35 +09:00
Hiroshi SHIBATA
6775e9a21b Bump strscan version to 3.0.1 2021-11-22 10:51:35 +09:00
Hiroshi SHIBATA
8cdb0ebb55 Bump etc version to 1.3.0 2021-11-22 10:51:35 +09:00
Hiroshi SHIBATA
bfed3296ec Bump io-wait version to 0.2.0 2021-11-22 10:51:35 +09:00
Hiroshi SHIBATA
4716a8e157 Bump fiddle version to 1.0.8 2021-11-22 10:51:35 +09:00
Hiroshi SHIBATA
f86b773b5c Bump rinda version to 0.1.1 2021-11-22 10:51:35 +09:00
Hiroshi SHIBATA
e6fced73e5 Bump stringio version to 3.0.1 2021-11-22 10:51:35 +09:00
Hiroshi SHIBATA
e735773fd4 Bump optparse version to 0.1.1 2021-11-22 10:51:35 +09:00
Hiroshi SHIBATA
b19b2e9867 Merge RubyGems 3.2.31 and Bundler 2.2.31 2021-11-22 10:51:35 +09:00
Hiroshi SHIBATA
e27381d289 Merge RubyGems 3.2.30 and Bundler 2.2.30 2021-11-22 10:51:35 +09:00