[pull] master from ruby:master - #1395
Merged
Merged
Conversation
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
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 : )