Age | Commit message (Collapse) | Author |
|
|
|
|
|
As commented in include/ruby/internal/abi.h, since teeny versions of
Ruby should guarantee ABI compatibility, `RUBY_ABI_VERSION` has no role
in released versions of Ruby.
Notes:
Merged: https://github.com/ruby/ruby/pull/6231
|
|
* Fix Array#[] with ArithmeticSequence with negative steps
Previously, Array#[] when called with an ArithmeticSequence
with a negative step did not handle all cases correctly,
especially cases involving infinite ranges, inverted ranges,
and/or exclusive ends.
Fixes [Bug #18247]
* Add Array#slice tests for ArithmeticSequence with negative step to test_array
Add tests of rb_arithmetic_sequence_beg_len_step C-API function.
* Fix ext/-test-/arith_seq/beg_len_step/depend
* Rename local variables
* Fix a variable name
Co-authored-by: Kenta Murata <3959+mrkn@users.noreply.github.com>
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
`self` is nearest Ruby method's `self`.
If there is no ruby frame, use toplevel `self` (`main`).
https://bugs.ruby-lang.org/issues/18780
Notes:
Merged: https://github.com/ruby/ruby/pull/6199
|
|
The `rb_profile_frames` API did not skip the two dummy frames that
each thread has at its beginning. This was unlike `backtrace_each` and
`rb_ec_parcial_backtrace_object`, which do skip them.
This does not seem to be a problem for non-main thread frames,
because both `VM_FRAME_RUBYFRAME_P(cfp)` and
`rb_vm_frame_method_entry(cfp)` are NULL for them.
BUT, on the main thread `VM_FRAME_RUBYFRAME_P(cfp)` was true
and thus the dummy thread was still included in the output of
`rb_profile_frames`.
I've now made `rb_profile_frames` skip this extra frame (like
`backtrace_each` and friends), as well as add a test that asserts
the size and contents of `rb_profile_frames`.
Fixes [Bug #18907] (<https://bugs.ruby-lang.org/issues/18907>)
Notes:
Merged: https://github.com/ruby/ruby/pull/6114
|
|
In test_bug_reporter and test_rubyoptions we intentionally
test child processes that cause SEGV. We run them with YJIT
if the parent uses YJIT so that the text description
matches the parent RUBY_DESCRIPTION.
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6149
|
|
|
|
It's very flaky for some unknown reason. Something we have
an extra EXITED event. I suspect some other test is causing this.
Notes:
Merged: https://github.com/ruby/ruby/pull/6133
|
|
We saw the following failure:
```
TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/v3/src/trunk-random3/test/-ext-/thread/test_instrumentation_api.rb:25]:
Expected 0..3 to include 4.
```
Which shouldn't happen unless somehow there was a leaked thread.
Notes:
Merged: https://github.com/ruby/ruby/pull/6128
|
|
* Extracted some assertions.
* Assert counter values should be positive.
Notes:
Merged: https://github.com/ruby/ruby/pull/6111
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6111
|
|
If you run tests with RUN_OPTS=--mjit, the test fixes in
https://github.com/ruby/ruby/pull/5872 don't work.
|
|
Recently `TestThreadInstrumentation#test_join_counters` often fails as
```
<[1, 1, 1]> expected but was
<[2, 2, 2]>.
```
Probably it seems that the thread is suspended more than once.
There may be no guarantee that the subject thread never be suspended
more than once.
|
|
[Bug #18900]
Thread#join and a few other codepaths are using native sleep as
a way to suspend the current thread. So we should call the relevant
hook when this happen, otherwise some thread may transition
directly from `RESUMED` to `READY`.
Notes:
Merged: https://github.com/ruby/ruby/pull/6101
|
|
Since enabling YJIT or MJIT drastically changes what could go wrong at
runtime, it's good to be front and center about whether they are enabled
when dumping a crash report. Previously, `RUBY_DESCRIPTION` and the
description printed when crashing can be different when a JIT is on.
Introduce a new internal data global, `rb_dynamic_description`, and set
it to be the same as `RUBY_DESCRIPTION` during initialization; use it
when crashing.
* version.c: Init_ruby_description(): Initialize and use
`rb_dynamic_description`.
* error.c: Change crash reports to use `rb_dynamic_description`.
* ruby.c: Call `Init_ruby_description()` earlier. Slightly more work
for when we exit right after printing the description but that
was deemed acceptable.
* include/ruby/version.h: Talk about how JIT info is not in
`ruby_description`.
* test/-ext-/bug_reporter/test_bug_reporter.rb: Remove handling for
crash description being different from `RUBY_DESCRIPTION`.
* test/ruby/test_rubyoptions.rb: ditto
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/5872
|
|
I suspect that sometimes on CI the last thread is prempted before eaching the exit hook
causing the test to flake. I can't find a good way to force it to run.
|
|
|
|
It previously failed with:
```
1) Failure:
TestThreadInstrumentation#test_thread_instrumentation_fork_safe [/home/runner/work/ruby/ruby/src/test/-ext-/thread/test_instrumentation_api.rb:50]:
<5> expected but was
<4>.
```
Suggesting one `EXIT` event wasn't fired or processed.
Adding an assetion on `Thead#status` may help figure out what is wrong.
Notes:
Merged: https://github.com/ruby/ruby/pull/6032
|
|
[Feature #18339]
After experimenting with the initial version of the API I figured there is a need
for an exit event to cleanup instrumentation data. e.g. if you record data in a
{thread_id -> data} table, you need to free associated data when a thread goes away.
Notes:
Merged: https://github.com/ruby/ruby/pull/6029
|
|
`test_thread_instrumentation_fork_safe` has been failing occasionaly
on Ubuntu and Arch. At this stage we're not sure why, all we know is
that the child exit with status 1.
I suspect that something entirely unrelated cause the forked children
to fail on exit, so by using `exit!(0)` and doing assertions in the
parent I hope to be resilient to that.
Notes:
Merged: https://github.com/ruby/ruby/pull/5983
|
|
The tests fail randomly on some platforms.
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20220605T213004Z.fail.html.gz
http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20220605T210003Z.fail.html.gz
```
[15737/21701] TestThreadInstrumentation#test_thread_instrumentation_fork_safe/home/chkbuild/chkbuild/tmp/build/20220605T213004Z/ruby/tool/lib/test/unit/assertions.rb:109:in `assert': Expected 0 to be nonzero?. (Test::Unit::AssertionFailedError)
```
The failures seem to depend on context switches. I suspect `sleep 0.05`
is too short, so this change tries to extend the wait time.
|
|
Ref: https://bugs.ruby-lang.org/issues/18339
Design:
- This tries to minimize the overhead when no hook is registered.
It should only incur an extra unsynchronized boolean check.
- The hook list is protected with a read-write lock as to cause
contention when some hooks are registered.
- The hooks MUST be thread safe, and MUST NOT call into Ruby as they
are executed outside the GVL.
- It's simply a noop on Windows.
API:
```
rb_internal_thread_event_hook_t * rb_internal_thread_add_event_hook(rb_internal_thread_event_callback callback, rb_event_flag_t internal_event, void *user_data);
bool rb_internal_thread_remove_event_hook(rb_internal_thread_event_hook_t * hook);
```
You can subscribe to 3 events:
- READY: called right before attempting to acquire the GVL
- RESUMED: called right after successfully acquiring the GVL
- SUSPENDED: called right after releasing the GVL.
The hooks MUST be threadsafe, as they are executed outside of the GVL, they also MUST NOT call any Ruby API.
Notes:
Merged: https://github.com/ruby/ruby/pull/5500
|
|
Should fix issues with parallel testing sometimes not running all
tests.
This should be viewed skipping whitespace changes.
Fixes [Bug #18731]
Notes:
Merged: https://github.com/ruby/ruby/pull/5839
|
|
Header file include/ruby/internal/abi.h contains RUBY_ABI_VERSION which
is the ABI version. This value should be bumped whenever an ABI
incompatible change is introduced.
When loading dynamic libraries, Ruby will compare its own
`ruby_abi_version` and the `ruby_abi_version` of the loaded library. If
these two values don't match it will raise a `LoadError`. This feature
can also be turned off by setting the environment variable
`RUBY_RUBY_ABI_CHECK=0`.
This feature will prevent cases where previously installed native gems
fail in unexpected ways due to incompatibility of changes in header
files. This will force the developer to recompile their gems to use the
same header files as the built Ruby.
In Ruby, the ABI version is exposed through
`RbConfig::CONFIG["ruby_abi_version"]`.
Notes:
Merged: https://github.com/ruby/ruby/pull/5474
|
|
Add a new macro BASE_SLOT_SIZE that determines the slot size.
For Variable Width Allocation (compiled with USE_RVARGC=1), all slot
sizes are powers-of-2 multiples of BASE_SLOT_SIZE.
For USE_RVARGC=0, BASE_SLOT_SIZE is set to sizeof(RVALUE).
Notes:
Merged: https://github.com/ruby/ruby/pull/5517
|
|
`@s1.set_len(3)` will raise so the `assert_equal` will never be ran.
|
|
Two tests abort intentionally and they create core files if
possible. In these case, we don't need to see core files
so disable by `"Process.setrlimit(Process::RLIMIT_CORE, 0)` for
those cases.
Notes:
Merged: https://github.com/ruby/ruby/pull/5466
|
|
A short (2 bytes) will cause unaligned struct accesses when strings are
used as a buffer to directly store binary data.
Notes:
Merged: https://github.com/ruby/ruby/pull/5432
|
|
|
|
Already these had been announced to be removed in 3.2.
Notes:
Merged: https://github.com/ruby/ruby/pull/5348
|
|
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
* Rename --jit to --mjit
[Feature #18349]
* Fix a few more --jit references
* Fix MJIT Actions
* More s/jit/mjit/ and re-introduce --disable-jit
* Update NEWS.md
* Fix test_bug_reporter_add
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
After 5680c38c75aeb5cbd219aafa8eb48c315f287d97, postponed job APIs now
expect to be called on native threads not managed by Ruby and handles
getting a NULL execution context. However, in debug builds the change
runs into an assertion failure with GET_EC() which asserts that EC is
non-NULL. Avoid the assertion failure by passing `false` for `expect_ec`
instead as the intention is to handle when there is no EC.
Add a test from John Crepezzi and John Hawthorn to exercise this
situation.
See GH-4108
See GH-5094
[Bug #17573]
Co-authored-by: John Hawthorn <john@hawthorn.email>
Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/5156
Merged-By: XrXr
|
|
Since the YJIT Ruby module is CRuby specific and not meant for general
use, it should live under RubyVM instead of at top level.
Notes:
Merged: https://github.com/ruby/ruby/pull/5038
|
|
```ruby
r, w = IO.pipe
r.close
IO.for_fd(w.fileno).close
```
This code closes a file descriptor `w.fileno`, but `w` doesn't know
the closing. Another code can open same file descriptor with opening
file (`f`). After that, the `w` will GCed and `w.fileno` is closed
again, and `f.fileno` is closed too, so IO operations for `f` (`f.close`)
will cause EBADF.
To fix this issue, do this test in another process.
|
|
This commit adds support for embedded strings with variable capacity and
uses Variable Width Allocation to allocate strings.
Notes:
Merged: https://github.com/ruby/ruby/pull/4933
|
|
There might be code out there that expect `ruby -v` to print only one
line. Since MJIT shows +JIT in `ruby -v` and RUBY_DESCRIPTION, let's
show +YJIT.
The crash report doesn't show anything about MJIT, so adjust the test.
The "test_ruby_version" test was unaware of RUBY_YJIT_ENABLE and so
was failing when the variable is set and inherited into the children
processes it spawns. Explicitly unset the variable in the test.
|
|
test-unit migration
|
|
This prevents early collection of the array. The GC doesn't see the
array on the stack when Ruby is compiled with optimizations enabled
Thanks @jhaberman for the test case
[ruby-core:105099] [Bug #18140]
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4676
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4612
|
|
|
|
If called with an autoloaded encoding that was not yet
initialized, `rb_enc_interned_str` would crash with
a NULL pointer exception.
See: https://github.com/ruby/ruby/pull/4119#issuecomment-800189841
Notes:
Merged: https://github.com/ruby/ruby/pull/4290
|
|
because the name "MJIT" is an internal code name, it's inconsistent with
--jit while they are related to each other, and I want to discourage future
JIT implementation-specific (e.g. MJIT-specific) APIs by this rename.
[Feature #17490]
|
|
Not to interfere in other tests.
Notes:
Merged: https://github.com/ruby/ruby/pull/4043
|
|
This speeds up all instance variable access, even when not in
verbose mode. Uninitialized instance variable warnings were
rarely helpful, and resulted in slower code if you wanted to
avoid warnings when run in verbose mode.
Implements [Feature #17055]
Notes:
Merged: https://github.com/ruby/ruby/pull/3879
|
|
* Otherwise those tests, etc cannot run on alternative Ruby implementations.
|