Skip to content

[pull] master from ruby:master - #1395

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

[pull] master from ruby:master#1395
pull[bot] merged 4 commits into
turkdevops:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Sep 10, 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 : )

ko1 and others added 4 commits September 10, 2026 22:54
assert_linear_performance() picks CLOCK_THREAD_CPUTIME_ID when it is
available.  That clock belongs to the native thread that reads it, and an
M:N thread moves between native threads, so two reads around one
measurement can come from different native threads and the elapsed time
comes out negative:

    Expected 0 to be <= -2.2150775009999997.

Reproduced with RUBY_MN_THREADS=2, 1500 fork/waitpid pairs per run: the
Ruby thread changed native thread 1, 9 and 10 times over three runs, and
the clock went backwards 1, 5 and 6 times, by as much as 0.38s.  The
default, =1 and =-1 never moved the main thread and never went backwards.
CLOCK_PROCESS_CPUTIME_ID stayed monotonic across 15 such migrations.

Prefer process CPU time when the M:N scheduler is on.  This only changes
which clock the assertion uses; it does not relax the assertion.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The clock belongs to the native thread that reads it.  An M:N Ruby thread
moves between native threads, so two reads taken from one Ruby thread can
come from different native threads and the later one can be smaller.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cont.c takes jit_cont_lock whenever an execution context is created or
freed.  cont_free() does it from a Ractor reclaiming its own dead root
fiber, outside the VM lock, so fork() can land there.  The child then
inherits the lock held by a thread that no longer exists, and aborts in
rb_jit_cont_finish():

    [BUG] pthread_mutex_destroy: Device or resource busy (EBUSY)

rb_thread_atfork_internal() already reinitializes the other locks another
thread may have held at the fork; jit_cont_lock was missing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The code in the rescue block of the core extension wasn't exercised in test. It calls `$stderr.warn` which is a private method so it would error. This adds a test to exercise that code and fixes the no method error.

ruby/syntax_suggest@f28514fe92
@pull pull Bot locked and limited conversation to collaborators Sep 10, 2026
@pull pull Bot added the ⤵️ pull label Sep 10, 2026
@pull
pull Bot merged commit 43b0792 into turkdevops:master Sep 10, 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