Commit graph

82615 commits

Author SHA1 Message Date
nagachika
f5c772fc7c bump teeny 2025-07-24 19:04:28 +09:00
nagachika
361d14319b merge revision(s) 5e5cec1b86:
Fix bigand_int edgecase returning false (#13987)
2025-07-24 17:15:54 +09:00
nagachika
83335453c2 Revert bump versions of default gems for extconf.rb changes.
This reverts commit 91263c7e52.
2025-07-24 16:44:37 +09:00
Nobuyoshi Nakada
9a269b15f5 [ruby/json] Run have_func with the header providing the declarations
95fb084027
2025-07-20 18:32:03 +09:00
Nobuyoshi Nakada
dd84f059cb [ruby/strscan] Run have_func with the header providing the declarations
18c0a59b65
2025-07-20 18:32:03 +09:00
Nobuyoshi Nakada
2af51ec480 [ruby/strscan] Update extconf.rb
(https://github.com/ruby/strscan/pull/158)

- `have_func` includes "ruby.h" by default.
- include "ruby/re.h" where `rb_reg_onig_match` is declared.

1ac96f47e9
2025-07-20 18:32:03 +09:00
Nobuyoshi Nakada
bf08633e0f [ruby/openssl] Run have_func with the header providing the declarations
b6f56c4540
2025-07-20 18:32:03 +09:00
nagachika
280cf2ad81 Bump io-nonblock to 0.3.0.1 2025-07-20 18:32:03 +09:00
Nobuyoshi Nakada
2493ec4f5e [ruby/io-nonblock] Run have_func with the header providing the declarations
70909f5362
2025-07-20 18:32:03 +09:00
nagachika
e997c7f26e Bump io-wait to 0.3.1.1 2025-07-20 18:32:03 +09:00
Nobuyoshi Nakada
8fab4f20a8 [ruby/io-wait] Run have_func with the header providing the declarations
48309d7877
2025-07-20 18:32:03 +09:00
nagachika
1d275bfd39 Bump io-console to 0.7.1.1 2025-07-20 18:32:03 +09:00
Nobuyoshi Nakada
fb42816c53 [ruby/io-console] Run have_func with the header providing the declarations
dd013030dd
2025-07-20 18:32:03 +09:00
nagachika
91263c7e52 bump etc-1.4.3.1 2025-07-20 18:32:03 +09:00
Nobuyoshi Nakada
fd6d582427 [ruby/etc] Run have_func with the header providing the declarations
6668bfd42a
2025-07-20 18:32:03 +09:00
nagachika
868bcf3807 Update dependency for goruby 2025-07-20 18:32:03 +09:00
nagachika
f0ec1ad827 Add compilation with GCC 14,15 on GitHub workflow 2025-07-20 18:32:03 +09:00
nagachika
407f6c9d05 merge revision(s) b42afa1dbc, 67b91e7807, f1f0cc14cc, 543e3a1896, ed2806117a, 46e4c86737: [Backport #21497]
Suppress gcc 15 unterminated-string-initialization warnings

	Drop an ignored attribute
	MIME-Version: 1.0
	Content-Type: text/plain; charset=UTF-8
	Content-Transfer-Encoding: 8bit

	GCC 13.3.0 (Ubuntu 24.04) emits the following warning:

	../symbol.c: In function ‘rb_id_attrset’:
	../symbol.c:175:9: warning: ‘nonstring’ attribute ignored on objects of type ‘const char[][8]’ [-Wattributes]
	  175 |         RBIMPL_ATTR_NONSTRING() static const char id_types[][8] = {
	      |         ^~~~~~~~~~~~~~~~~~~~~

	Separate `__has_attribute` from `defined(__has_attribute)`

	Fix Visual C warnings:
	```
	regenc.h(121): warning C4067: unexpected tokens following preprocessor directive - expected a newline
	```

	Cast up `int` instruction code to `VALUE`

	Fix Visual C warnings:
	```
	iseq.c(3793): warning C4312: 'type cast': conversion from 'int' to 'void *' of greater size
	iseq.c(3794): warning C4312: 'type cast': conversion from 'int' to 'void *' of greater size
	```

	Do not let files depend on a phony target

	Detect `clock_gettime` and `clock_getres` for winpthreads
2025-07-20 18:32:03 +09:00
nagachika
1e37f34eaa merge revision(s) d77e02bd85: [Backport #21497]
[Bug #21497] [ruby/socket]: add full prototype
	MIME-Version: 1.0
	Content-Type: text/plain; charset=UTF-8
	Content-Transfer-Encoding: 8bit

	otherwise, gcc 15 will complain:

	> init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3
	>   573 |     return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len);
	>       |                   ^~~~~~~~ ~~~~~~~
	> In file included from init.c:11:
	> rubysocket.h:294:5: note: declared here
	>   294 | int Rconnect();
	>       |     ^~~~~~~~

	> sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1
	>    33 |         SOCKSinit("ruby");
	>       |         ^~~~~~~~~ ~~~~~~
	> In file included from sockssocket.c:11:
	> rubysocket.h:293:6: note: declared here
	>   293 | void SOCKSinit();
	>       |      ^~~~~~~~~

	Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
2025-07-20 15:49:08 +09:00
nagachika
9b9f244b98 merge revision(s) 1181a682a6, 0cec4a14fb, d84a811f31: [Backport #21448]
[Bug #21448] Use `getentropy(2)` only on macOS

	If this is not a system call, then it is using getrandom (which would
	have been tried already), and cannot be used as a replacement for the
	random devices.

	Restore getrandom(2) path for Linux with glibc 2.36 or later

	This is a follow-up to commit b120f5e38d (avoid fork-unsafe arc4random
	implementations, 2018-09-04).

	Avoid defining a no-op fill_random_bytes_syscall() if arc4random_buf(3)
	exists, but we are unsure if it is fork-safe. Check for other options
	instead. IOW, see if getrandom(2) is available.

	glibc 2.36, released in 2022, started to provide arc4random_buf(3) on
	Linux. This causes fill_random_bytes_syscall() to use neither of them
	and makes Random.urandom solely rely on getentropy(3) via
	fill_random_bytes_urandom().

	While the glibc implementation is safe, I did not add it to the list
	because using getrandom(2) directly is preferable on Linux.

	[Bug #21448] Reorder trials in `fill_random_bytes`

	First try dedicated system calls, such as `getrandom` or `getentropy`,
	next possible libraries, then fallback to `/dev/urandom`.
2025-07-20 15:43:31 +09:00
nagachika
f4de78f2b4 merge a revision partially 097d742a1e: [Backport #20009] 2025-07-20 10:35:44 +09:00
nagachika
581be2b79c merge revision(s) 097d742a1e: [Backport #20009]
[Bug #20009] Support marshaling non-ASCII name class/module
2025-07-19 11:16:49 +09:00
John Hawthorn
3471ee0749 Fix generic_ivar_set_shape_ivptr for table rebuild
[Bug #21438]

Previously GC could trigger a table rebuild of the generic ivar
st_table in the middle of calling the st_update callback. This could
cause entries to be reallocated or rearranged and the update to be for
the wrong entry.

This commit adds an assertion to make that case easier to detect, and
replaces the st_update with a separate st_lookup and st_insert.

Also free after insert in generic_ivar_set_shape_ivptr

Previously we were performing a realloc and then inserting the new value
into the table. If the table was flagged as requiring a rebuild, this
could trigger GC work and marking within that GC could access the ivptr
freed by realloc.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2025-07-19 10:23:17 +09:00
Hiroshi SHIBATA
111a49e77e Bump up resolv-0.3.1 for Ruby 3.3 2025-07-19 10:19:07 +09:00
Hiroshi SHIBATA
7fb19cf803 Partly picked from https://github.com/ruby/ruby/pull/10073 2025-07-02 11:05:40 +09:00
Luke Gruber
a52a2e852a thread_cleanup: set CFP to NULL before clearing ec's stack
We clear the CFP first so that if a sampling profiler interrupts the current thread during `rb_ec_set_vm_stack`,
`thread_profile_frames` returns early instead of trying to walk the stack that's no longer set on the ec.

The early return in `thread_profile_frames` was introduced at eab7f4623f.

Fixes [Bug #21441]
2025-06-29 13:08:00 +09:00
nagachika
1fb5ab411f merge revision(s) c1877d431e: [Backport #21437]
[ruby/date] [Bug #21437] Date#hash for large years

	Addresses https://bugs.ruby-lang.org/issues/21437

	Signed-off-by: Dmitry Dygalo <dmitry.dygalo@workato.com>

	31f07bc576
2025-06-29 12:31:38 +09:00
nagachika
a976792832 merge revision(s) 2e7e78cd59: [Backport #21440]
[Bug #21440] Stop caching member list in frozen Data/Struct class
2025-06-29 12:27:54 +09:00
Hiroshi SHIBATA
de512b7a3d We don't need to specify winsdk version
a205407e16 fixed that workaround
2025-06-25 15:22:36 +09:00
nagachika
8908cb0782 merge revision(s) fa85d23ff4: [Backport #21380]
[Bug #21380] Prohibit modification in String#split block

	Reported at https://hackerone.com/reports/3163876
2025-06-15 12:51:29 +09:00
nagachika
a205407e16 merge revision(s) 72bda0f981: [Backport #21255]
[Bug #21255] Win32: Do not export `__declspec(selectany)` symbols

	```
	x64-vcruntime140-ruby350.def : error LNK2001: unresolved external symbol Avx2WmemEnabledWeakValue
	```
2025-06-14 17:43:36 +09:00
nagachika
dc88822c3e merge revision(s) e1adb6cb15: [Backport #21283]
Win: Suppress false warnings from Visual C 17.14.1

	https://developercommunity.visualstudio.com/t/warning-C5287:-operands-are-different-e/10877942?

	It is not able to silence "operands are different enum types"
	warnings, even using an explicit cast, as the message says.
2025-06-14 17:41:04 +09:00
nagachika
5de0c228a3 merge revision(s) 2297afda7f: [Backport #21340]
Include stdbool.h without checking with autoconf

	As reported in <https://bugs.ruby-lang.org/issues/21340>, older autoconf
	have an AC_HEADER_STDBOOL that's incompatible with C23. Autoconf 2.72
	fixed the macro, but also mentions that it's obsolescent since all
	current compilers have this header.

	Since we require C99 [1] and VS 2015 [2], we might actually be able take
	that suggestion and include stdbool.h without a check. I want to try
	this on rubyci.org and will revert if this cause any issues. Not
	touching AC_HEADER_STDBOOL in configure.ac for now.

	[1]: https://bugs.ruby-lang.org/issues/15347
	[2]: https://bugs.ruby-lang.org/issues/19982
2025-06-14 11:41:49 +09:00
nagachika
d5c8fd2043 merge revision(s) f6cbf499bc: [Backport #21354]
Fix Symbol#to_proc (rb_sym_to_proc) to be ractor safe

	In non-main ractors, don't use `sym_proc_cache`. It is not thread-safe
	to add to this array without a lock and also it leaks procs from one
	ractor to another. Instead, we create a new proc each time. If this
	results in poor performance we can come up with a solution later.

	Fixes [Bug #21354]
2025-06-14 11:39:08 +09:00
Hiroshi SHIBATA
fb8248b3e8 Disabled TRAP cache of CodeQL 2025-06-10 11:06:34 +09:00
Hiroshi SHIBATA
6ca52090ed Remove hardcoded version of rake from Bundler tests
The original commit is 85f73e42a5
2025-06-03 10:12:43 +09:00
nagachika
c1c068e43c Follow up for 3809389984. The type of jump_to_next_insn() is Option<()> on ruby_3_3. 2025-05-24 18:12:02 +09:00
nagachika
7230a070e3 Follow up for 3809389984. jump_to_next_insn() require 3rd argument on ruby_3_3. 2025-05-24 17:27:33 +09:00
nagachika
3809389984 merge revision(s) cbf9c088f8: [Backport #21310]
YJIT: End the block after OPTIMIZE_METHOD_TYPE_CALL (#13245)
2025-05-24 16:38:32 +09:00
nagachika
24c994b91a merge revision(s) 0564973196: [Backport #21357]
[Bug #21357] Fix crash in Hash#merge with block

	Prior to 49b306ecb9
	the `optional_arg` passed from `rb_hash_update_block_i` to `tbl_update`
	was a hash value (i.e. a VALUE). After that commit it changed to an
	`update_call_args`.

	If the block sets or changes the value, `tbl_update_modify` will set the
	`arg.value` back to an actual value and we won't crash. But in the case
	where the block returns the original value we end up calling
	`RB_OBJ_WRITTEN` with the `update_call_args` which is not expected and
	may crash.

	`arg.value` appears to only be used to pass to `RB_OBJ_WRITTEN` (others
	who need the `update_call_args` get it from `arg.arg`), so I don't think
	it needs to be set to anything upfront. And `tbl_update_modify` will set
	the `arg.value` in the cases we need the write barrier.
2025-05-24 10:25:59 +09:00
nagachika
8f895758d9 merge revision(s) 49b306ecb9: [Backport #21333]
[Bug #21333] Prohibit hash modification inside Hash#update block
2025-05-24 10:24:22 +09:00
Nobuyoshi Nakada
d15fdb5c7f Win32: Initialize the systemtime function before converting FILETIME 2025-05-22 21:10:17 +09:00
Hiroshi SHIBATA
ff1d615746 Don't need to store download cache of vcpkg
vcpkg can detect their cache from `vcpkg/installed`.
2025-05-22 15:54:24 +09:00
nagachika
f57dd4470b merge revision(s) 80a1a1bb8a: [Backport #21257]
YJIT: Fix potential infinite loop when OOM (GH-13186)

	Avoid generating an infinite loop in the case where:
	1. Block `first` is adjacent to block `second`, and the branch from `first` to
	   `second` is a fallthrough, and
	2. Block `second` immediately exits to the interpreter, and
	3. Block `second` is invalidated and YJIT is OOM

	While pondering how to fix this, I think I've stumbled on another related edge case:
	1. Block `incoming_one` and `incoming_two` both branch to block `second`. Block
	   `incoming_one` has a fallthrough
	2. Block `second` immediately exits to the interpreter (so it starts with its exit)
	3. When Block `second` is invalidated, the incoming fallthrough branch from
	   `incoming_one` might be rewritten first, which overwrites the start of block
	   `second` with a jump to a new branch stub.
	4. YJIT runs of out memory
	5. The incoming branch from `incoming_two` is then rewritten, but because we're
	   OOM we can't generate a new stub, so we use `second`'s exit as the branch
	   target. However `second`'s exit was already overwritten with a jump to the
	   branch stub for `incoming_one`, so `incoming_two` will end up jumping to
	   `incoming_one`'s branch stub.

	Fixes [Bug #21257]
2025-05-18 16:25:01 +09:00
nagachika
1f226f1efe merge revision(s) b959263b58: [Backport #21344]
Fix Exception#detailed_message for GC compaction

	Before this commit, the test fails with RGENGC_CHECK_MODE enabled:

	    TestException#test_detailed_message_under_gc_compact_stress [test/ruby/test_exception.rb:1466]:
	    <"\e[1mfoo (\e[1;4mRuntimeError\e[m\e[1m)\e[m\n" +
	    "\e[1mbar\e[m\n" +
	    "\e[1mbaz\e[m"> expected but was
	    <"\e[1mfoo (\e[1;4mRuntimeError\e[m\e[1m)\e[m\n" +
	    "\e[1m\x00\x00\x00\x00\x00\x00\x00\e[m">.
2025-05-18 13:32:52 +09:00
nick evans
74f46982eb Bump net-imap to v0.4.21 for Ruby 3.3 (CVE-2025-43857)
v0.4.20 addresses CVE-2025-43857 (GHSA-j3g3-5qv5-52mj).

v0.4.21 fixes bugs in `Net::IMAP::SequenceSet`.
2025-05-18 13:30:24 +09:00
nagachika
551c444f81 merge revision(s) b48b841378, 2fe8b9cd3d: [Backport #21327]
digest.so needs ruby/digest.h which is installed by build-ext

	Copy to path with the base name
2025-05-18 12:00:23 +09:00
nagachika
8a1d738b80 merge revision(s) 3113bc8d44:
stat command is not provided on Windows
2025-05-18 10:24:11 +09:00
nagachika
cb49400d68 merge revision(s) 7793b59c8d: [Backport #21331]
[Bug #21331] Prohibit hash modification during stlike loop
2025-05-17 15:57:05 +09:00
nagachika
b25bfd33e9 merge revision(s) 7f5b4fb26e:
Remove unused retval assignments
2025-05-17 15:56:46 +09:00