[pull] master from ruby:master#1202
Merged
Merged
Conversation
`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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )