Skip to content

[pull] master from ruby:master - #1450

Merged
pull[bot] merged 17 commits into
turkdevops:masterfrom
ruby:master
Sep 27, 2026
Merged

pull[bot] merged 17 commits into
turkdevops:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

rwstauner and others added 17 commits September 26, 2026 21:24
capa does not include the terminator, so when a buffer moves
between strings with different terminator lengths the capacity has to
be converted or we will try to free the buffer with the wrong size:

    [BUG] buffer 0x00005030039ff768 freed with old_size=18, but was allocated with size=17
    [BUG] buffer 0x00005631adc48f48 freed with old_size=8268, but was allocated with size=8269

Three related fixes:

* `rb_str_tmp_frozen_release`: convert tmp's capacity to orig's
  terminator length when handing the buffer back.  This is the inverse
  of a calculation added to `rb_str_tmp_frozen_no_embed_acquire` in
  91619f0.

* `heap_str_make_shared`: since bdf3032
  the root created by `rb_str_tmp_frozen_acquire` does not copy the
  encoding of the string it takes the buffer from, so the two can have
  different terminator lengths and the root's capacity has to be
  adjusted as well, otherwise the root frees fewer bytes than were
  allocated once its only child stops sharing the buffer.  termlen is
  passed in because the caller assigns the encoding of the root after
  this function returns.

* `rb_str_tmp_frozen_no_embed_acquire`: unset `STR_BORROWED` on the
  root.  `STR_SET_SHARED` sets `STR_BORROWED` on roots with
  `klass == 0` to mark the ones that may have other children, but this
  root only ever has orig as its child, so unset it like
  `heap_str_make_shared` does.  Any string that starts sharing the
  root later will set the flag again.  Without this
  `rb_str_tmp_frozen_release` never gives the buffer back, so strings
  written by `io_fwrite` stay shared and are copied on their next
  modification.

The release and make_shared adjustments go together
as they were previously canceling each other out.
…n given

Timeout.timeout in Ruby 2.3 takes at most two arguments, so EnvUtil.timeout always raised ArgumentError there. EnvUtil.terminate reaches it through Debugger#dump on Windows when gdb is installed, which broke test_terminate_reaps_exited_child on windows-latest 2.3.

ruby/test-unit-ruby-core@42d15562b2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It has been `#if 0` since 04e95f8 disabled it to avoid infinite recursion at loading transcoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
include/ruby/win32.h already maps stat, lstat, access, truncate, utimensat, unlink, rename and getenv to the same rb_w32_* functions when compiling the core with RUBY_EXPORT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Neither mswin nor mingw defines HAVE_GETGROUPS, so the remaining condition already covers Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing in them has used <fcntl.h> or the L_* and *_OK macros since 9afa9ba split dln_find.c out and f9e9eee removed ruby_add_suffix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The polling loop saved and restored the sets through fixed fd_set
buffers, which hold only FD_SETSIZE (64) sockets.  From the second
poll on, sockets past that were no longer watched, so IO.select could
miss them until the timeout.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
When FD_SETSIZE (64) or more sockets were ready, copy_fd stopped there
and a ready pipe or other non-socket handle was left out of the result.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The polling loop restored every socket into the sets before checking
the deadline, so a timed-out select returned them all as ready.  When
IO.select forced a zero timeout for buffered data, sockets with nothing
to read were reported readable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
RUBYLIB and -I are UTF-8 on Windows, but ruby_push_include walked them with CharNext in the ANSI code page. With a DBCS code page such as 932, the last byte of a UTF-8 character was taken as a lead byte and swallowed the following `;`, so `C:/あ;C:/b` became a single load path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Windows

The dln_find.c object built on its own receives UTF-8 command names from process.c, but scanned them with CharNext in the ANSI code page. With a DBCS code page, a backslash after a multibyte character was missed, and `exec("あ\\foo", "x")` ran `あ\foo` found in PATH instead of the one under the current directory. The copy that win32.c includes keeps using its code page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ruby_push_include was its last user. A path separator never appears inside a multibyte character, so walk RUBYLIB and -I by bytes everywhere. This also fixes the same skipped separator on Cygwin, where CharNext came from windows.h.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`rb_w32_write_console` returns the number of UTF-16 code units it wrote, so writing "あ" to a console returned 1 instead of 3 as it does for files and NUL. Use the result only to tell success, as the other callers do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On 64-bit Windows, WOW64 sets PROCESSOR_ARCHITEW6432 when a 32-bit process starts, like PROCESSOR_ARCHITECTURE under the x64 emulation on ARM64, so test_execopts_env and test_execopts_unsetenv_others fail on i386-mswin32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On i386-mswin32 the ruby DLL has no arch prefix and is named vcruntime140-ruby410.dll, so the vcruntime140*.dll check rejected every x86 binary package. Match only the VC runtime DLL names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Breakages specific to i386-mswin32, such as the size_t atomic fetch_add and the prism bit.h build failure, were found only by auditing. Run check on x86 as well so that CI catches them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Sep 27, 2026
@pull pull Bot added the ⤵️ pull label Sep 27, 2026
@pull
pull Bot merged commit 7fb3844 into turkdevops:master Sep 27, 2026
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants