Commit Graph
103666 Commits
Author SHA1 Message Date
dependabot[bot]andGitHub 35b6914381 Bump the github-actions group across 1 directory with 4 updates
Bumps the github-actions group with 4 updates in the / directory: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action), [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) and [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `github/codeql-action/init` from 4.39.1 to 4.39.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9b3254085494b55a0f7c4c2b3d2d52cc712ce370...1fc58d04a4d4374f921bdac573c3811c240f9c26)

Updates `github/codeql-action/analyze` from 4.39.1 to 4.39.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9b3254085494b55a0f7c4c2b3d2d52cc712ce370...1fc58d04a4d4374f921bdac573c3811c240f9c26)

Updates `github/codeql-action/upload-sarif` from 4.39.1 to 4.39.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9b3254085494b55a0f7c4c2b3d2d52cc712ce370...1fc58d04a4d4374f921bdac573c3811c240f9c26)

Updates `taiki-e/install-action` from 2.89.1 to 2.90.0
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/682ce6c3c696a4cd5168a05f98e51aa02b877941...b80e2bb2635f28eb98b9fce1e2f0887e1535c6b2)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.90.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-11-06 02:08:32 +00:00
Hiroshi SHIBATAandClaude Opus 5 30fd927272 Build the fast fallback of TCPSocket.new on mswin
Every piece the Happy Eyeballs Version 2 path needed from pthread, pipe(2) and select(2) now has a Windows counterpart, so a host that answers with both families no longer waits for the IPv6 attempt to time out there. MinGW stays out, since its pthread emulation was never tested against this path, and its tests are omitted instead of passing by connecting sequentially.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-06 10:44:26 +09:00
Hiroshi SHIBATAandClaude Opus 5 d81710bca7 Read the resolution error and SO_ERROR the way Winsock declares them
Winsock has no EAI_ADDRFAMILY, and its getsockopt(2) takes a char * where the option value is an int. Neither compiles as written once the fast fallback is built for Windows.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-06 10:44:26 +09:00
Hiroshi SHIBATAandClaude Opus 5 1813275e7e Wait for the exceptfds of the connecting sockets on Windows
Winsock reports a failed non-blocking connect(2) through the exceptfds of select(2) alone, so the fast fallback never learned that an attempt had been refused. Only Windows fills the set, so select(2) behaves as before elsewhere.

[Bug #18661]

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-06 10:44:26 +09:00
Hiroshi SHIBATAandClaude Opus 5 f902d4822d Notify the hostname resolution through a pipe on Windows as well
rb_w32_select_with_thread() polls the read end of a pipe, so the resolution threads can report through one there too. The waiter goes through nonblock_set() because the Windows fcntl() has no F_GETFL.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-06 10:44:26 +09:00
Hiroshi SHIBATAandClaude Opus 5 6c342f179b Restore blocking mode on the fast fallback socket on Windows
The connection attempts race each other non-blocking, and TCPSocket.new wrapped the winner as it was. Windows creates every other socket blocking, and a read parked on a non-blocking one there cannot be interrupted by IO#close. POSIX sockets start out non-blocking, so leave them alone and test that they stay so.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-06 10:44:26 +09:00
Hiroshi SHIBATAandClaude Opus 5 4e38061ca4 Size the fast fallback arrays at compile time
cl.exe does not implement variable length arrays, and none of these ever holds more than the two address families the fast fallback resolves. The hints array only needed one live element at a time, so fill the entry in place instead.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-06 10:44:26 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 3df017d756 Build the fast fallback resolver thread body on Windows
Windows has neither SIGPIPE nor pthread_sigmask(3), so skip the masking there. The test-only resolution delay uses SleepEx() there, because Sleep() reaches rb_w32_Sleep() through the ruby DLL and waits through a Ruby thread this thread does not have.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 10:44:26 +09:00
Burdette LamarandGitHub 5d81cb4595 [DOC] Doc for MatchData#offset (#19716) 2026-11-06 01:35:58 +00:00
Burdette LamarandGitHub 0129627d9a [DOC] Doc for MatchData#match (#19710) 2026-11-06 10:35:21 +09:00
Burdette LamarandGitHub 55c16817d0 [DOC] Doc for MatchData#post_match (#19717) 2026-11-06 10:30:58 +09:00
Burdette LamarandGitHub b424f51a9d [DOC] Doc for MatchData#pre_match (#19719) 2026-11-06 10:30:19 +09:00
Burdette LamarandGitHub b4a0e978b0 [DOC] What's Here for MatchData 2026-11-06 10:27:05 +09:00
Thomas KlemmandGitHub f0de939f61 YJIT: Check singleton attached-object identity in C (GH-19648)
Use rb_yjit_attached_object_is() for the compile-time attachment check.
It keeps the singleton flag test in C and returns only a boolean to Rust.
The predicate cannot raise, allocate, or take locks. Guard emission is
unchanged, and the IO exclusion stays in Rust.
2026-11-06 00:24:11 +00:00
Matt Valentine-Houseandgit 0dcc5b6ab5 [ruby/mmtk] Exclude flaky Gem::SafeYAML linear time test
test_load_block_scalar_strip_indicator_in_linear_time asserts on wall
clock time, and it fails intermittently when Ruby runs with MMTk.

https://github.com/ruby/mmtk/commit/627a8eca44
2026-11-05 23:08:31 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 f6996b73a2 CI: Build and test YJIT on arm64 mswin
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 07:15:38 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 39c036cfd0 win32: Support YJIT on arm64
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 07:15:38 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 88423501d3 YJIT: Register unwind info for the JIT region on arm64 mswin
longjmp() and C++ exceptions unwind JIT frames with RtlUnwindEx() as on x64, which fails with STATUS_BAD_FUNCTION_TABLE without unwind info.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 07:15:38 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 9df2ed64f4 Flush the instruction cache on arm64 mswin
cl and clang-cl do not define __GNUC__, so rb_jit_icache_invalidate() compiled to nothing with cl and hit the #error with clang-cl, which defines __aarch64__.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 07:15:38 +09:00
Luke GruberandLuke Gruber ec4f61e689 GC page pool comment changes 2026-11-05 15:44:28 -05:00
Luke GruberandLuke Gruber a8ad8b9a60 Change arena bookkeeping to use free_mask and advised_mask
This makes it so that we don't have to have a LIFO freelist like before.
Now, we hand out pages that are lower addresses in an arena instead of
handing out the latest released page. This is almost equivalent, but
should allow us to madvise larger chunks at a time and keep used pages
more tightly together.
2026-11-05 15:44:28 -05:00
Luke GruberandLuke Gruber 33b6c8872a Move page pool freelist bookkeeping out of the page bodies
The page pool used to thread its free lists through a word at offset 0
of each free body, with the arena back-pointer just past it and the "already
advised" flag stolen from the link's low bit. That made the head of every free
body live memory.

Now we keep the bookkeeping in the arena instead as a per-body struct holding
the freelist index, so that a free body is entirely dead memory. Reclaim now
advises whole bodies, and since it can walk them in address order it issues one
call per run of physically adjacent free heap pages: a fully free arena costs one
madvise rather than 32.

Also, delete the global hot list. It has been unreachable since PAGE_POOL_HOT_MAX
went to 0. With no hot or warm tier left, cold_freelist is just the freelist.
2026-11-05 15:44:28 -05:00
Erik Berlinandgit a17ffc3136 [ruby/json] Java generator: raise TypeError for a String key whose to_s is broken
When a Hash key is a String subclass, both generators call its to_s.
generator.c raises a TypeError in convert_string_subclass if to_s
doesn't return a String. The Java generator passed the result on, then
fell back to TypeConverter.convertToType, which returned the key itself
because it already is a String. So JSON.generate(s => 1) produced
{"test":1} on JRuby instead of raising.

Raise the same TypeError, with the same message, in castKey. The class
names go through to_s like PRIsVALUE does, so anonymous classes show as
#<Class:0x...> the way they do on CRuby.

This lets test_string_subclass_with_broken_to_s run on JRuby.

Part of https://github.com/ruby/json/issues/1123

https://github.com/ruby/json/commit/cf987b116d
2026-11-05 20:39:51 +00:00
Erik Berlinandgit cd73168f6a [ruby/json] Run the RFC 8785 number tests on JRuby 10.1.3 and later
The RFC 8785 number formatter uses Float#to_s, so these tests were
skipped on every engine but CRuby. JRuby 10.1.3 gives the shortest
round-trip digits in Float#to_s
(https://github.com/jruby/jruby/pull/9916), and all 26 tests pass
there. Older JRuby versions print the smallest subnormal as 4.9e-324,
so they still skip them.

Part of https://github.com/ruby/json/issues/1123

https://github.com/ruby/json/commit/8bda05413e
2026-11-05 20:38:55 +00:00
Kevin Newtonandgit 2a3b7678ff [ruby/prism] Also accept a do block on a command call in call arguments for Ruby 4.1
https://github.com/ruby/prism/commit/284b2a1d4a
2026-11-05 19:37:41 +00:00
Marco Rothandgit f86308e920 [ruby/prism] Accept a do block on a command call in call arguments for 3.4 and 4.0
https://github.com/ruby/prism/commit/f8a7247124
2026-11-05 19:37:41 +00:00
Rintaro MATSUIandGitHub 4e33571f76 ZJIT: Rewrite Integer#upto in Ruby (#19501)
* ZJIT: Rewrite Integer#upto in Ruby

* Match the C implementation in Ruby Integer#upto

Use `until from > to` so that it compares the same way as the C version,
including when `to` is NaN.
Raise ArgumentError when the comparator returns nil, like `ensure_cmp`.
Add tests for both cases.

* Remove the C implementation of Integer#upto

Define Integer#upto outside with_jit so that the interpreter also uses the Ruby version, and drop :c_trace.
2026-11-05 11:16:37 -08:00
Nobuyoshi Nakada cd4f33f0bb Check if C and Assember sources are UTF-8 2026-11-06 04:05:47 +09:00
705b36e119 [ruby/json] Check duplicate keys when a non String/Symbol key follows a String/Symbol key
Fix: #1125

https://github.com/ruby/json/commit/bbb92b5f87

Co-Authored-By: Jean Boussier <[email protected]>
2026-11-05 17:48:49 +00:00
aed61e36b3 [ruby/rubygems] Remove partial git checkout when submodule update fails
If `git submodule update` fails after `git reset --hard` has populated
the destination, `GitProxy#installed_to?` considers the half-finished
checkout installed. When the error is rescued during `missing_specs?`,
the subsequent resolve then skips the checkout, never builds native
extensions, and `bundle install` exits successfully.

Remove the destination when `git reset --hard` or the submodule step
after it fails, before re-raising, so the next attempt checks out again
and the error reaches the user. A failed `reset --hard` can leave a
partially written tree that `installed_to?` would misjudge the same way.

https://github.com/ruby/rubygems/commit/cf89bb0c8c

Co-authored-by: AI (Pi/Claude Fable 5.1) <[email protected]>
2026-11-05 16:52:56 +00:00
John Hawthorn 46020b782b Test the optimized method redefinition warning in multi-ractor mode
Methods are defined under the VM lock once a second Ractor exists, and
debug builds fail "assert_critical_section_entered == 0" in
rb_vm_check_ints if the performance warning is emitted before it is
released. Cover redefining the method directly, from a refinement, and
from a prepended module.
2026-11-05 10:34:19 -05:00
John Hawthorn 9022974666 Defer the optimized method redefinition warning when refining under the VM lock
Since add_refined_method_entry() is called from rb_method_entry_make()
under the VM lock, it has to collect the performance warning in the
caller's method_entry_warnings like the rest of rb_method_entry_make().
Otherwise refining an optimized method that the refined class defines
itself, such as

    refine(Integer) { def +(other) end }

with Warning[:performance] enabled and a second Ractor around, warns with
the lock held and trips the critical section assertion in
rb_vm_check_ints.

The struct moves up so that add_refined_method_entry() can see its
members.
2026-11-05 10:34:19 -05:00
Luke GruberandJohn Hawthorn 358733a634 Warn about optimized method redefinition after releasing the VM lock
rb_vm_check_redefinition_opt_method() is called from rb_method_entry_make()
under the VM lock, where it must not call rb_category_warn(): that
dispatches Warning.warn and writes to $stderr, both of which can run
arbitrary Ruby code. When called with the lock held it now collects the
method entries to warn about, and rb_add_method() and friends emit the
"Redefining 'X#y' disables interpreter and JIT optimizations" warnings
once the lock is released.
2026-11-05 10:34:19 -05:00
John Hawthorn 3b01c23769 Test constant redefinition warning in multi-ractor mode
Warning.warn can run arbitrary Ruby code, so it must not be called while
the VM lock is held. Once the process is in multi-ractor mode const_set
takes the lock, and a Warning.warn that waits on another Ractor which
needs the lock deadlocks if the warning is emitted under it. Debug builds
fail "assert_critical_section_entered == 0" in rb_vm_check_ints instead.
2026-11-05 10:33:58 -05:00
Luke GruberandJohn Hawthorn ad531b0f18 Warn about constant redefinition after releasing the VM lock
const_tbl_update() runs under the VM lock, where it must not call
rb_warn(): that dispatches Warning.warn and writes to $stderr, both of
which can run arbitrary Ruby code. It now records what to warn about,
and its callers emit the warning once the lock is released.
2026-11-05 10:33:58 -05:00
Peter Zhu 9e2fb37e61 [DOC] Update documentation_guide about UTF-8 in C 2026-11-06 00:11:32 +09:00
Peter Zhu 491e36e187 [DOC] Inline UTF-8 docs into C code
Since https://github.com/ruby/ruby/pull/15579, we are now able to use UTF-8
comments in C code, so we no longer need to have UTF-8 documentation in
separate files and use RDoc :include: directives.
2026-11-06 00:11:32 +09:00
Matt Valentine-House 336946c045 Fix UAF in marshall.c
Marshal.load uses load_arg to store state but wasn't marking the src string or
the proc. Usually not a problem because the caller would keep the string
alive. But when a Ractor.make_shareable falls back to using Marshal then nothing
keeps the dump string alive, so if GC either frees or moves the string during
the copy, then the loader holds a dangling pointer.

This commit marks the string and the proc.
2026-11-05 12:50:13 +00:00
Nobuyoshi Nakada 0a12e7cbb7 rb_ary_join: Check the argument first
Check if the receiver is empty after the separator conversion, that
can call `to_str` and modify the receiver array.

Reported-by: amasen02
2026-11-05 18:41:11 +09:00
a041273a4c [ruby/net-http] Reject CR/LF in the address and port of a proxy CONNECT request
The CONNECT request line and its Host field were built from the address
and port without the CR/LF check that the other request components get.

Reported-by: Christiaan Swiers (https://hackerone.com/cswiers)

https://github.com/ruby/net-http/commit/a4af412951

Co-Authored-By: Claude Mythos 5.1 <[email protected]>
2026-11-05 08:49:10 +00:00
BurdetteLamarandPeter Zhu 7f9638f41e [DOC] Doc for MatchData#names 2026-11-05 17:21:42 +09:00
BurdetteLamarandPeter Zhu e565e93056 [DOC] Doc for MatchData#named_captures 2026-11-05 17:21:01 +09:00
9f8ceadc6e [ruby/rubygems] Don't flag a frozen fallback onto a locked ruby gem as insecure
Falling back from a platform row to the ruby gem the lockfile also locks printed the warning meant for platform gems installed from a lockfile that locks only their ruby version.

https://github.com/ruby/rubygems/commit/8c3973bb84

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 08:19:54 +00:00
5b107ccfbd [ruby/rubygems] Fall back to locked gems under an uncovered Ruby ABI in frozen mode
A frozen bundle on a Ruby ABI missing from RUBY ABIS stopped at install and at Bundler.setup, although the platform or ruby gems the lockfile locks can still be installed. validate_platforms! lets a locked ruby platform through, so treat the Ruby ABI the same way. Once `bundle lock --add-ruby-abi` locks that Ruby's content-addressed gem, the platform gem the fallback installed no longer satisfies the platform row.

https://github.com/ruby/rubygems/commit/201d53c126

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 08:19:53 +00:00
BurdetteLamarandPeter Zhu de713ee014 [DOC] Doc for MatchData#match_length 2026-11-05 17:15:21 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 364cd99232 Define RB_LEN2FIX
LEN2FIX expanded to RB_LEN2FIX, which was never defined, so an extension using it failed to build or load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 16:47:43 +09:00
Jenny Shenandgit 7709aa259b [ruby/rubygems] Tag each locked content address with the Ruby ABI it is built for
https://github.com/ruby/rubygems/commit/f61c320096
2026-11-05 04:06:36 +00:00
Jenny Shenandgit 7d1fe7bd94 [ruby/rubygems] Add bundle lock --add-ruby-abi and --remove-ruby-abi
https://github.com/ruby/rubygems/commit/5f00887d34
2026-11-05 04:06:35 +00:00
Jenny Shenandgit 20f7a33f7d [ruby/rubygems] Record the Ruby ABIs a lockfile's content-addressed gems cover
https://github.com/ruby/rubygems/commit/4e215189cd
2026-11-05 04:06:35 +00:00
Jenny Shenandgit e42b078754 [ruby/rubygems] Prune locked content addresses the Gemfile's ruby directive rules out
https://github.com/ruby/rubygems/commit/f71111a334
2026-11-05 04:06:34 +00:00