Skip to content

[pull] master from ruby:master#1202

Merged
pull[bot] merged 15 commits into
turkdevops:masterfrom
ruby:master
Jul 11, 2026
Merged

[pull] master from ruby:master#1202
pull[bot] merged 15 commits into
turkdevops:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Jul 11, 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 : )

BurdetteLamar and others added 15 commits July 11, 2026 10:36
`fiber_current()` reads `GET_EC()`, which the compiler may inline as a
thread-pointer-relative TLS access whose base is cached in a callee-saved
register.  `coroutine_transfer` preserves callee-saved registers across the
stack switch, so when a fiber's coroutine resumes on a different native
thread (M:N scheduler migration), the cached thread pointer is stale and
`fiber_current()` returns another thread's execution context.

`fiber_switch()` calls `fiber_current()` right after the transfer.  With
`-DRUBY_DEBUG=1` this trips `VM_ASSERT(ec == rb_current_ec_noinline())` in
`rb_current_execution_context`; in release builds it silently uses the
wrong (or NULL) EC.  Only reproduces with >= 2 Ractors (a single Ractor
does not migrate the coroutine).

Read the current EC through `rb_current_ec_noinline()` in `fiber_current()`,
which forces a fresh thread-pointer load.  fiber_current() is only used by
the (cold) fiber machinery, so the non-inlined read costs nothing on hot
paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`rb_ractor_sched_barrier_join` unconditionally did `barrier_waiting_cnt++`.
A thread can reach it (via `vm_lock_enter`) while its Ractor's
`sched.running` is set but the thread is not yet in the VM running set
(`sched.is_running == false`) -- e.g. resuming from a blocking IO wait.
Counting such a thread pushes `barrier_waiting_cnt` past `running_cnt - 1`
and trips `VM_ASSERT(running_cnt - 1 >= barrier_waiting_cnt)` in
`ractor_sched_barrier_completed_p`; in release builds the unsigned
`(running_cnt - barrier_waiting_cnt) == 1` completion test can underflow.

Increment `barrier_waiting_cnt` only when `cr->threads.sched.is_running`
(O(1), toggled together with running_threads add/del).  A not-running
thread is parked at the barrier regardless, so it is safe to wait without
counting.

NOTE (open): this guards the count at the join site.  A stricter fix would
prevent a not-running thread from reaching barrier_join at all; that needs
care so it still waits for the barrier rather than proceeding during
compaction.  Left for review.

Reproduction is currently coupled with a separate pre-existing compaction
use-after-poison on a blocked-IO thread's STR_TMPLOCK buffer (only the
IO-read blocking path triggers this barrier window), so a standalone
passing test awaits that fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Stage `install-nodoc` under DESTDIR, bundle the vcpkg runtime DLLs,
the VC runtime and the license terms of everything redistributed,
then archive the tree into a relocatable zip. Groundwork for official
Windows binary packages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mkmf applies $configure_args to every extension build, so a leftover
--with-opt-dir pointing into the build machine's vcpkg tree breaks or
taints gem compilation on the destination machine. Strip arguments
containing absolute paths from CONFIG["configure_args"] when
assembling a binary package.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
App-local copies of vcruntime140*.dll are never serviced by Windows
Update. Assume the VC++ Redistributable is installed instead, as
suggested by naruse.

https://bugs.ruby-lang.org/issues/22180#change-117963

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Apply the review suggestion from nobu on GH-17662.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A GNU tar earlier in PATH cannot write zip with -a, which made the
archiving step environment dependent. Pointed out by Copilot on
GH-17662.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Normalize backslashes in the directory arguments before they reach
Dir.glob so an overridden vcpkg path fails clearly instead of through
a misleading missing-DLL abort, and abort when no vcpkg copyright files
are collected so the package never ships a bundled DLL without its
license terms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Build the package on the check jobs and smoke-test the produced zip:
extract it, require openssl/fiddle/psych/zlib with PATH restricted to
System32, and assert that no VC runtime is bundled and no
build-machine path remains in configure_args.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Embedded structs only use 7 bits for the length, so it will overflow if
the GC can allocate large slots. We need to add the cap to struct_alloc.
@pull pull Bot locked and limited conversation to collaborators Jul 11, 2026
@pull pull Bot added the ⤵️ pull label Jul 11, 2026
@pull pull Bot merged commit 916d8c1 into turkdevops:master Jul 11, 2026
1 of 2 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.

4 participants