Граф коммитов

82481 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 0044b6aefc merge revision(s) bc002971b6ad483dbf69b8a275c44412bb6ab954: [Backport #20094]
[Bug #20094] Distinguish `begin` and parentheses
2024-05-29 16:35:18 -07:00
Takashi Kokubun b3f2ccea5e merge revision(s) 18eaf0be905e3e251423b42d6f4e56b7cae1bc3b: [Backport #20494]
[Bug #20494] Search non-default directories for GMP

	Co-Authored-by: lish82 (Hiroki Katagiri)
2024-05-29 16:18:29 -07:00
Takashi Kokubun cf643fabd5 merge revision(s) d292a9b98ce03c76dbe13138d20b9fbf613cc02d: [Backport #20453]
[Bug #20453] segfault in Regexp timeout

	https://bugs.ruby-lang.org/issues/20228 started freeing `stk_base` to
	avoid a memory leak. But `stk_base` is sometimes stack allocated (using
	`xalloca`), so the free only works if the regex stack has grown enough
	to hit `stack_double` (which uses `xmalloc` and `xrealloc`).

	To reproduce the problem on master and 3.3.1:

	```ruby
	Regexp.timeout = 0.001
	/^(a*)x$/ =~ "a" * 1000000 + "x"'
	```

	Some details about this potential fix:

	`stk_base == stk_alloc` on
	[init](dde99215f2/regexec.c (L1153)),
	so if `stk_base != stk_alloc` we can be sure we called
	[`stack_double`](dde99215f2/regexec.c (L1210))
	and it's safe to free. It's also safe to free if we've
	[saved](dde99215f2/regexec.c (L1187-L1189))
	the stack to `msa->stack_p`, since we do the `stk_base != stk_alloc`
	check before saving.

	This matches the check we do inside
	[`stack_double`](dde99215f2/regexec.c (L1221))
2024-05-29 15:52:15 -07:00
Takashi Kokubun 5c06e93074 merge revision(s) 6ade36c06b7cef948099b8f5f483763498705d12: [Backport #20414]
`Fiber#raise` recursively raises on nested resuming_fiber. (#10482)

	* Improve consistency of `Fiber.current.raise`.
2024-05-29 15:47:26 -07:00
Takashi Kokubun b44c02ad5a merge revision(s) c479492a6701dcef3d3a96de8946ecf7beb079d4: [Backport #20427]
Resize ary when `Array#sort!` block modifies embedded ary

	In cases where `rb_ary_sort_bang` is called with a block and
	tmp is an embedded array, we need to account for the block
	potentially impacting the capacity of ary.

	ex:
	```
	var_0 = (1..70).to_a
	var_0.sort! do |var_0_block_129, var_1_block_129|
	  var_0.pop
	  var_1_block_129 <=> var_0_block_129
	end.shift(3)
	```

	The above example can put the array into a corrupted state
	resulting in a heap buffer overflow and possible segfault:
	```
	ERROR: AddressSanitizer: heap-buffer-overflow on address [...]
	WRITE of size 560 at 0x60b0000034f0 thread T0 [...]
	```

	This commit adds a conditional to determine when the capacity
	of ary has been modified by the provided block. If this is
	the case, ensure that the capacity of ary is adjusted to
	handle at minimum the len of tmp.
2024-05-29 15:44:55 -07:00
Takashi Kokubun 5688bcb54a merge revision(s) 5d1702e01a36e11b183fe29ce10780a9b1a41cf0: [Backport #20413]
Enumerator should use a non-blocking fiber, change `rb_fiber_new` to be non-blocking by default. (#10481)
2024-05-29 15:43:01 -07:00
Takashi Kokubun a24f19742b merge revision(s) 58918788abd63901588e4aa1e39b5c057321c10a: [Backport #20342]
[Bug #20342] Consider wrapped load in `main` methods
2024-05-29 15:40:49 -07:00
Takashi Kokubun 72a45ac7a3 merge revision(s) 3a04ea2d0379dd8c6623c2d5563e6b4e23986fae: [Backport #20305]
[Bug #20305] Fix matching against an incomplete character

	When matching against an incomplete character, some `enclen` calls are
	expected not to exceed the limit, and some are expected to return the
	required length and then the results are checked if it exceeds.
2024-05-29 15:11:56 -07:00
Takashi Kokubun 6e46a363a8 merge revision(s) a7ff264477105b5dc0ade6facad4176a1b73df0b: [Backport #20393]
Don't clear pending interrupts in the parent process. (#10365)
2024-05-29 11:46:33 -07:00
Takashi Kokubun 541fc816fc [ruby/zlib] Bump up 3.1.1 2024-05-29 11:35:46 -07:00
Takashi Kokubun 2ae6df6d03 merge revision(s) 9f8f32bf9f3758ba67dd2afe7e07d9eccb68bbc7: [Backport #20289]
[ruby/zlib] In Zlib::GzipReader#eof? check if we're actually at eof

	Only consider it eof if we read ahead and something fills the buf.
	If not, we may only have empty blocks and the footer.

	Fixes https://github.com/ruby/zlib/pull/56

	https://github.com/ruby/zlib/commit/437bea8003
2024-05-29 11:35:23 -07:00
Takashi Kokubun 2f4fe76eff Skip under_gc_compact_stress on s390x (#10073) 2024-05-29 11:13:02 -07:00
Takashi Kokubun 548c7cb9f5 merge revision(s) 7e4b1f8e1935a10df3c41ee60ca0987d73281126: [Backport #20322]
[Bug #20322] Fix rb_enc_interned_str_cstr null encoding

	The documentation for `rb_enc_interned_str_cstr` notes that `enc` can be
	a null pointer, but this currently causes a segmentation fault when
	trying to autoload the encoding. This commit fixes the issue by checking
	for NULL before calling `rb_enc_autoload`.
2024-05-29 11:07:07 -07:00
Takashi Kokubun 8f1084db9b merge revision(s) dc146babf47a84bbd1f176d766637d4a40327019,f23d5028059078a346efc977287b669d494a5a3f,a0f7de814ae5c299d6ce99bed5fb308a05d50ba0: [Backport #20296]
[Bug #20296] Clear errinfo when `exception: false`

	[Bug #20296] Refine the test

	[Bug #20296] Fix the default assertion message
2024-05-29 11:00:27 -07:00
Takashi Kokubun 22c1e5f126 Suppress -Wclobbered warnings
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-05-29 10:57:43 -07:00
Hiroya Fujinami e5a1119f1b Reduce `if` for decreasing counter on OP_REPEAT_INC (#9393)
This commit also reduces the warning `'stkp' may be used
uninitialized in this function`.
2024-05-29 10:51:23 -07:00
Nobuyoshi Nakada bcf5cd3ba4 Initialize errno variables and fix maybe-uninitialized warnings 2024-05-29 10:48:19 -07:00
Takashi Kokubun bbb3075c46 Sort backport revisions by commit timestamps 2024-05-29 10:39:10 -07:00
Takashi Kokubun f12c947192 merge revision(s) e04146129ec6898dd6a9739dad2983c6e9b68056: [Backport #20292]
[Bug #20292] Truncate embedded string to new capacity
2024-05-29 10:19:49 -07:00
Takashi Kokubun a8b2317d16 merge revision(s) 78d9fe69479d32214a52ad7291c3973f1b6b7f6f: [Backport #20286]
Ensure that exiting thread invokes end-of-life behaviour. (#10039)
2024-05-29 10:02:15 -07:00
Takashi Kokubun 6aaf673e4d Skip broken SSL provider tests for freebsd 2024-05-29 09:59:52 -07:00
Takashi Kokubun 6e9dbcbacc Force-skip a LOAD_PATH spec for rhel_zlinux 2024-05-29 09:56:55 -07:00
Peter Zhu 3cab9b9979 Change test_warmup_frees_pages to check each size pool
This should help in debugging the intermittent test failures on CI:

    TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2779]:
    <201> expected but was
    <202>.
2024-05-29 09:40:45 -07:00
Takashi Kokubun 8c29a3776e Skip a flaky Ractor test
https://github.com/ruby/ruby/actions/runs/9289798294/job/25564563437
2024-05-29 09:38:46 -07:00
Takashi Kokubun 015d6bae8b Skip a flaky test in RBS 2024-05-29 09:32:03 -07:00
Takashi Kokubun 9cb804a2bd merge revision(s) 04729fe68dceddab045be7324e26c2bb15aa62c7: [Backport #20288]
Fix exception handling in `rb_fiber_scheduler_set`. (#10042)
2024-05-28 17:46:47 -07:00
Takashi Kokubun 0e96dd93c5 merger.rb: Don't ask "conflicts resolved?" if not needed 2024-05-28 17:46:44 -07:00
Takashi Kokubun 4d34fb54b0 redmine-backporter.rb: Prepend commit: to every revision 2024-05-28 17:17:04 -07:00
Takashi Kokubun 6383d0afac merge revision(s) 015b0e2e1d312e2be60551587389c8da5c585e6f,ac1e9e443a0d6a4d4c0801c26d1d8bd33d9eb431: [Backport #20195]
YJIT: Fix unused warnings

	```
	warning: unused import: `condition::Condition`
	  --> src/asm/arm64/arg/mod.rs:13:9
	   |
	13 | pub use condition::Condition;
	   |         ^^^^^^^^^^^^^^^^^^^^
	   |
	   = note: `#[warn(unused_imports)]` on by default

	warning: unused import: `rb_yjit_fix_mul_fix as rb_fix_mul_fix`
	   --> src/cruby.rs:188:9
	    |
	188 | pub use rb_yjit_fix_mul_fix as rb_fix_mul_fix;
	    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	warning: unused import: `rb_insn_len as raw_insn_len`
	   --> src/cruby.rs:142:9
	    |
	142 | pub use rb_insn_len as raw_insn_len;
	    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
	    |
	    = note: `#[warn(unused_imports)]` on by default
	```

	Make asm public so it stops warning about unused public stuff in there.

	YJIT: Fix ruby2_keywords splat+rest and drop bogus checks

	YJIT didn't guard for ruby2_keywords hash in case of splat calls that
	land in methods with a rest parameter, creating incorrect results.

	The compile-time checks didn't correspond to any actual effects of
	ruby2_keywords, so it was masking this bug and YJIT was needlessly
	refusing to compile some code. About 16% of fallback reasons in
	`lobsters` was due to the ISeq check.

	We already handle the tagging part with
	exit_if_supplying_kw_and_has_no_kw() and should now have a dynamic guard
	for all splat cases.

	Note for backporting: You also need 7f51959ff1.

	[Bug #20195]
2024-05-28 17:10:33 -07:00
Takashi Kokubun d7ad603739 redmine-backporter.rb: Remove an unneeded space
from #backport_command_string

I don't want to leave unneeded spaces in the command history by
copy-pasting the entire line.
2024-05-28 17:01:13 -07:00
Takashi Kokubun 9c81bbbbb7 merge revision(s) 7f51959ff14fbe06bc1afd283d1af17b26161cf4: [Backport #20204]
YJIT: Move guard up for a case of splat+rest

	Previously, YJIT put the guard for having enough items to extract from
	splat array at a place where the side exit is invalid, so if the guard
	fails, YJIT could raise something other than ArgumentError. Move the
	guard up to a place before any stack manipulation.

	[Bug #20204]
2024-05-28 16:55:49 -07:00
Takashi Kokubun 912c7df0a5 Skip a failing spec for rhel_zlinux
https://rubyci.s3.amazonaws.com/rhel_zlinux/ruby-3.3/log/20240528T214850Z.fail.html.gz

```
1)
Execution variable $: default $LOAD_PATH entries until sitelibdir included have @gem_prelude_index set FAILED
Expected ["/home/chkbuild/build/20240528T214850Z/mspec/lib/mspec/lib",
 "/home/chkbuild/build/20240528T214850Z/mspec/lib",
 "./ruby/tool/lib",
 "/home/linux1/chkbuild/tmp/build/20240528T214850Z/lib/ruby/site_ruby/3.3.0",
 "/home/linux1/chkbuild/tmp/build/20240528T214850Z/lib/ruby/site_ruby/3.3.0/s390x-linux",
 "/home/linux1/chkbuild/tmp/build/20240528T214850Z/lib/ruby/site_ruby",
 "/home/linux1/chkbuild/tmp/build/20240528T214850Z/lib/ruby/vendor_ruby/3.3.0",
 "/home/linux1/chkbuild/tmp/build/20240528T214850Z/lib/ruby/vendor_ruby/3.3.0/s390x-linux",
 "/home/linux1/chkbuild/tmp/build/20240528T214850Z/lib/ruby/vendor_ruby",
 "/home/linux1/chkbuild/tmp/build/20240528T214850Z/lib/ruby/3.3.0",
 "/home/linux1/chkbuild/tmp/build/20240528T214850Z/lib/ruby/3.3.0/s390x-linux"].include? "/home/chkbuild/build/20240528T214850Z/lib/ruby/site_ruby/3.3.0"
to be truthy but was false
/home/chkbuild/build/20240528T214850Z/rubyspec/language/predefined_spec.rb:885:in `block (2 levels) in <top (required)>'
/home/chkbuild/build/20240528T214850Z/rubyspec/language/predefined_spec.rb:846:in `<top (required)>'
```

It does have /home/linux1/chkbuild/tmp/build/20240528T214850Z/lib/ruby/site_ruby/3.3.0,
so it seems actually fine. It seems to be failing due to its setup
issues. Skipping this until we figure out how to fix it.
2024-05-28 16:52:29 -07:00
Nobuyoshi Nakada 9443606caf [rubygems/rubygems] Should rescue vendored net-http exception
https://github.com/rubygems/rubygems/commit/7d2c4cf364
2024-05-28 16:38:55 -07:00
Takashi Kokubun 239a8cc7d7 merger.rb: Auto-detect tickets when --ticket is not given 2024-05-28 16:30:45 -07:00
Takashi Kokubun 90fda2da5f merger.rb: Drop an obsoleted command from help
It was needed only for SVN, and we dropped SVN support.
2024-05-28 15:54:54 -07:00
Hiroshi SHIBATA 077558ee2b
[Bug #20511] Update reline-0.5.7 (#10848)
* Update reline-0.5.7

* Update irb-1.13.1
2024-05-28 15:54:39 -07:00
Takashi Kokubun 917f3e5d22 merge revision(s) f36a71e26995b69ff72bc132bbcf40ad89571414: [Backport #20307]
[Bug #20307] Fix `Hash#update` to make frozen copy of string keys
2024-05-28 15:17:51 -07:00
Nobuyoshi Nakada 7d3e71330f Extract `RHASH_STRING_KEY_P` 2024-05-28 15:17:51 -07:00
Nobuyoshi Nakada 691aab8d3a Extract `RHASH_IDENTHASH_P` 2024-05-28 15:17:51 -07:00
Alan Wu 4024feba55 Fix RegExp warning causing flaky Ripper failure
Sometimes this file get picked up and break Ripper tests:

    TestRipper::Generic#test_parse_files:test/ruby
    assert_separately failed with error message
    pid 63392 exit 0
    | test_regexp.rb:2025: warning: character class has duplicated range

https://github.com/ruby/ruby/actions/runs/7699956651/job/20982702553#step:12:103
2024-05-28 15:05:52 -07:00
NARUSE, Yui 93d7bf5c5c
merge revision(s) bbd249e351af7e4929b518a5de73a832b5617273: [Backport #20192] (#10249)
* merge revision(s) bbd249e351af7e4929b518a5de73a832b5617273: [Backport #20192]

	YJIT: Properly reject keyword splat with `yield`

	We don't have support for keyword splat anywhere, but we tried to
	compile these anyways in case of `invokeblock`. This led to bad things
	happening such as passing the wrong value and passing a hash into
	rb_yjit_array_len(), which raised in the middle of compilation.

	[Bug #20192]

* Skip a new test for RJIT
2024-05-28 14:52:47 -07:00
Takashi Kokubun f18ba2c6c6 merger.rb: Use commit: prefix in more places 2024-05-28 14:29:07 -07:00
Takashi Kokubun b77b5c1915 merge revision(s) 5e0c17145131e073814c7e5b15227d0b4e73cabe: [Backport #20169]
Make io_fwrite safe for compaction

	[Bug #20169]

	Embedded strings are not safe for system calls without the GVL because
	compaction can cause pages to be locked causing the operation to fail
	with EFAULT. This commit changes io_fwrite to use rb_str_tmp_frozen_no_embed_acquire,
	which guarantees that the return string is not embedded.
2024-05-28 14:22:45 -07:00
Takashi Kokubun 62f450285b merger.rb: Improve the help message
It wasn't clear whether the backport command takes a commit hash or a
ticket number.
2024-05-28 14:10:26 -07:00
Takashi Kokubun 4c00719566 Allow failing test-annocheck
It causes flaky failures like this:

```
+ /usr/bin/docker build --rm -t ruby-fedora-annocheck-copy --build-arg=FILES=ruby -f ../src/tool/annocheck/Dockerfile-copy .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  556.5MB

Step 1/6 : FROM docker.io/fedora:latest
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
```

It seems not that important to maintain the job for backports, so let's
allow failing it until we fix it in master branch.
2024-05-28 13:58:23 -07:00
Takashi Kokubun c564c4a099 Sync merger.rb from master 2024-05-28 13:53:43 -07:00
Takashi Kokubun 82ff749451 Sync redmine-backporter.rb from master 2024-05-28 13:39:30 -07:00
Takashi Kokubun 46dbcd8e9b Sync .gitignore from master
to avoid committing unrelated files unexpectedly
2024-05-28 13:39:05 -07:00
Hiroshi SHIBATA 8dda932bcd Fix extension installer for out-of-place build
https://github.com/ruby/ruby/pull/9673#issuecomment-2019028293
2024-05-28 13:30:26 -07:00
Hiroshi SHIBATA cf460840b8 Guard makefile target at cross-build
http://rubyci.s3.amazonaws.com/crossruby/crossruby-master-aarch64/log/20240325T041917Z.fail.html.gz
2024-05-28 13:30:26 -07:00