summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-06-05Get rid of `rb_shape_t.flags`Jean Boussier
Now all flags are only in the `shape_id_t`, and can all be checked without needing to dereference a pointer. Notes: Merged: https://github.com/ruby/ruby/pull/13515
2025-06-04ZJIT: Add newrange support (#13505)Stan Lo
* Add newrange support to zjit * Add RangeType enum for Range insn's flag * Address other feedback Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2025-06-05mark main Ractor objectKoichi Sasada
`RUBY_DEBUG=gc_stress ./miniruby -e0` crashes because of this marking miss. BTW, to use `RUBY_DEBUG=gc_stress` we need to specify `--enable-debug-env` configure option. This is why I couldn't repro on my environments. see c0c94ab183d0d428595ccb74ae71ee945f1afd45 Notes: Merged: https://github.com/ruby/ruby/pull/13506
2025-06-04ZJIT: Implement side exits for entry frames (#13469)Takashi Kokubun
Co-authored-by: Max Bernstein <tekknolagi@gmail.com> Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2025-06-04ZJIT: Spill to the stack using arguments instead of FrameStateAlan Wu
The FrameState on the SendWithoutBlock represents the entry state, but for instructions that push to the stack in the middle of the instruction before actually doing the send like opt_aref_with, the FrameState is incorrect. We need to write to the stack using the arguments for the instruction. Notes: Merged: https://github.com/ruby/ruby/pull/13468
2025-06-04[ruby/did_you_mean] Revert "Alias value to take in old Ruby"Hiroshi SHIBATA
This reverts commit https://github.com/ruby/did_you_mean/commit/15d7b0bfa573. https://github.com/ruby/did_you_mean/commit/86a7daca19
2025-06-04Get rid of frozen shapes.Jean Boussier
Instead `shape_id_t` higher bits contain flags, and the first one tells whether the shape is frozen. This has multiple benefits: - Can check if a shape is frozen with a single bit check instead of dereferencing a pointer. - Guarantees it is always possible to transition to frozen. - This allow reclaiming `FL_FREEZE` (not done yet). The downside is you have to be careful to preserve these flags when transitioning. Notes: Merged: https://github.com/ruby/ruby/pull/13289
2025-06-04[ruby/psych] Revert "Alias value or join to take in old Ruby"Hiroshi SHIBATA
This reverts commit https://github.com/ruby/psych/commit/1a4d383efe0b. https://github.com/ruby/psych/commit/2f51c02280
2025-06-04[ruby/uri] Revert "Alias value or join to take in old Ruby"Hiroshi SHIBATA
This reverts commit https://github.com/ruby/uri/commit/443ed0cf8540. https://github.com/ruby/uri/commit/9e51838a04
2025-06-04[ruby/date] Removed workaround for assert_ractorHiroshi SHIBATA
https://github.com/ruby/date/commit/700e44ef54
2025-06-04[ruby/time] Removed workaround for assert_ractorHiroshi SHIBATA
https://github.com/ruby/time/commit/337410e971
2025-06-04[ruby/etc] Removed workaround for assert_ractorHiroshi SHIBATA
https://github.com/ruby/etc/commit/fd61177b71
2025-06-03Fix scheduler warningJean Boussier
``` test/fiber/test_scheduler.rb:98: warning: Scheduler should implement #fiber_interrupt ``` Notes: Merged: https://github.com/ruby/ruby/pull/13501
2025-06-03Fix memory leak in Prism's RubyVM::InstructionSequence.newPeter Zhu
[Bug #21394] There are two ways to make RubyVM::InstructionSequence.new raise which would cause the options->scopes to leak memory: 1. Passing in any (non T_FILE) object where the to_str raises. 2. Passing in a T_FILE object where String#initialize_dup raises. This is because rb_io_path dups the string. Example 1: 10.times do 100_000.times do RubyVM::InstructionSequence.new(nil) rescue TypeError end puts `ps -o rss= -p #{$$}` end Before: 13392 17104 20256 23920 27264 30432 33584 36752 40032 43232 After: 9392 11072 11648 11648 11648 11712 11712 11712 11744 11744 Example 2: require "tempfile" MyError = Class.new(StandardError) String.prepend(Module.new do def initialize_dup(_) if $raise_on_dup raise MyError else super end end end) Tempfile.create do |f| 10.times do 100_000.times do $raise_on_dup = true RubyVM::InstructionSequence.new(f) rescue MyError else raise "MyError was not raised during RubyVM::InstructionSequence.new" end puts `ps -o rss= -p #{$$}` ensure $raise_on_dup = false end end Before: 14080 18512 22000 25184 28320 31600 34736 37904 41088 44256 After: 12016 12464 12880 12880 12880 12912 12912 12912 12912 12912 Notes: Merged: https://github.com/ruby/ruby/pull/13496
2025-06-03[ruby/tmpdir] Restore Ractor.yield style test for old version of RubyHiroshi SHIBATA
https://github.com/ruby/tmpdir/commit/f12c766996
2025-06-03[ruby/time] Alias value or join to take in old RubyHiroshi SHIBATA
https://github.com/ruby/time/commit/2a1827b0ce
2025-06-03[ruby/json] Update `JSONInRactorTest` to handle Ruby 3.5 Ractors.Jean Boussier
https://github.com/ruby/json/commit/d42b36963d
2025-06-03[ruby/strscan] Support `Ractor#value`Hiroshi SHIBATA
(https://github.com/ruby/strscan/pull/157) This is same as https://github.com/ruby/stringio/pull/134 --------- https://github.com/ruby/strscan/commit/141f9cf9b6 Co-authored-by: Koichi Sasada <ko1@atdot.net>
2025-06-03[ruby/pathname] Alias value or join to take in old RubyHiroshi SHIBATA
https://github.com/ruby/pathname/commit/c501767d12
2025-06-03[ruby/uri] Alias value or join to take in old RubyHiroshi SHIBATA
https://github.com/ruby/uri/commit/443ed0cf85
2025-06-03[ruby/io-wait] Alias value or join to take in old RubyHiroshi SHIBATA
https://github.com/ruby/io-wait/commit/cf84aea70d
2025-06-03[ruby/did_you_mean] Omit some tests with JRubyHiroshi SHIBATA
https://github.com/ruby/did_you_mean/commit/a7a438ae27
2025-06-03[ruby/did_you_mean] Alias value to take in old RubyHiroshi SHIBATA
https://github.com/ruby/did_you_mean/commit/15d7b0bfa5
2025-06-03[ruby/psych] Alias value or join to take in old RubyHiroshi SHIBATA
https://github.com/ruby/psych/commit/1a4d383efe
2025-06-03[ruby/stringio] Support `Ractor#value`Hiroshi SHIBATA
(https://github.com/ruby/stringio/pull/134) from https://bugs.ruby-lang.org/issues/21262 We need to alias `Ractor#value` to `Ractor#take` for old versions of Ruby. --------- https://github.com/ruby/stringio/commit/9954dabd80 Co-authored-by: Koichi Sasada <ko1@atdot.net> Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2025-06-03[ruby/io-console] Alias value or join to take in old RubyHiroshi SHIBATA
https://github.com/ruby/io-console/commit/7106d05219
2025-06-03[ruby/etc] Alias value or join to take in old RubyHiroshi SHIBATA
https://github.com/ruby/etc/commit/3dbe760bed
2025-06-03[ruby/digest] Alias value to take in old RubyHiroshi SHIBATA
https://github.com/ruby/digest/commit/1eaee7d4fe
2025-06-03[ruby/date] Alias value to take in old RubyHiroshi SHIBATA
https://github.com/ruby/date/commit/1ce29a26dd
2025-06-03[rubygems/rubygems] Partially phase out x64-mingw32 in favour of ↵Nicholas La Roux
x64-mingw-ucrt (platforms) - the x64-mingw32 platform has been superseded by x64-mingw-ucrt - the mingw-ucrt platform is present as of Windows 10, which was released 10 years ago in 2015 and all versions prior to 10 are end-of-life and 10 will be by mid October 2025 - newer rubies use the mingw-ucrt platform instead of the mingw32 platform, meaning using the deprecated platform can cause issues during gem installation https://github.com/rubygems/rubygems/commit/b9d871022e
2025-06-03[rubygems/rubygems] misc: fix spellingJohn Bampton
https://github.com/rubygems/rubygems/commit/0e40e7d938
2025-06-02Fix test_loading_kwargs_memory_leakPeter Zhu
The test fails with: TestISeq#test_loading_kwargs_memory_leak [test/ruby/test_iseq.rb:882]: pid 18222 exit 1 | -:2:in '<main>': undefined method 'iseq_to_binary' for main (NoMethodError) Notes: Merged: https://github.com/ruby/ruby/pull/13494
2025-06-02compile.c: Handle anonymous variables in `outer_variable_cmp`Jean Boussier
[Bug #21370] Notes: Merged: https://github.com/ruby/ruby/pull/13436
2025-05-31skip failing test in a weekKoichi Sasada
``` 1) Failure: TestGc#test_gc_stress_at_startup [/home/chkbuild/chkbuild/tmp/build/20250530T213003Z/ruby/test/ruby/test_gc.rb:799]: [Bug #15784] pid 1748790 killed by SIGSEGV (signal 11) (core dumped). 1. [3/3] Assertion for "success?" | Expected #<Process::Status: pid 1748790 SIGSEGV (signal 11) (core dumped)> to be success?. ```
2025-05-31skip flaky testKoichi Sasada
``` 1) Failure: TestProcess#test_warmup_frees_pages [/tmp/ruby/src/trunk-random1/test/ruby/test_process.rb:2772]: <164348> expected but was <165985>. ``` can someone investigate it? Notes: Merged: https://github.com/ruby/ruby/pull/13478
2025-05-31`Ractor::Port`Koichi Sasada
* Added `Ractor::Port` * `Ractor::Port#receive` (support multi-threads) * `Rcator::Port#close` * `Ractor::Port#closed?` * Added some methods * `Ractor#join` * `Ractor#value` * `Ractor#monitor` * `Ractor#unmonitor` * Removed some methods * `Ractor#take` * `Ractor.yield` * Change the spec * `Racotr.select` You can wait for multiple sequences of messages with `Ractor::Port`. ```ruby ports = 3.times.map{ Ractor::Port.new } ports.map.with_index do |port, ri| Ractor.new port,ri do |port, ri| 3.times{|i| port << "r#{ri}-#{i}"} end end p ports.each{|port| pp 3.times.map{port.receive}} ``` In this example, we use 3 ports, and 3 Ractors send messages to them respectively. We can receive a series of messages from each port. You can use `Ractor#value` to get the last value of a Ractor's block: ```ruby result = Ractor.new do heavy_task() end.value ``` You can wait for the termination of a Ractor with `Ractor#join` like this: ```ruby Ractor.new do some_task() end.join ``` `#value` and `#join` are similar to `Thread#value` and `Thread#join`. To implement `#join`, `Ractor#monitor` (and `Ractor#unmonitor`) is introduced. This commit changes `Ractor.select()` method. It now only accepts ports or Ractors, and returns when a port receives a message or a Ractor terminates. We removes `Ractor.yield` and `Ractor#take` because: * `Ractor::Port` supports most of similar use cases in a simpler manner. * Removing them significantly simplifies the code. We also change the internal thread scheduler code (thread_pthread.c): * During barrier synchronization, we keep the `ractor_sched` lock to avoid deadlocks. This lock is released by `rb_ractor_sched_barrier_end()` which is called at the end of operations that require the barrier. * fix potential deadlock issues by checking interrupts just before setting UBF. https://bugs.ruby-lang.org/issues/21262 Notes: Merged: https://github.com/ruby/ruby/pull/13445
2025-05-29Fix memory leak with invalid yield in prismPeter Zhu
[Bug #21383] The following script leaks memory: 10.times do 20_000.times do eval("class C; yield; end") rescue SyntaxError end puts `ps -o rss= -p #{$$}` end Before: 16464 25536 29424 35904 39552 44576 46736 51600 56096 59824 After: 13488 16160 18240 20528 19760 21808 21680 22272 22064 22336 Notes: Merged: https://github.com/ruby/ruby/pull/13464
2025-05-29[Bug #21380] Prohibit modification in String#split blockNobuyoshi Nakada
Reported at https://hackerone.com/reports/3163876 Notes: Merged: https://github.com/ruby/ruby/pull/13462
2025-05-28[rubygems/rubygems] test(ruby): fix spellingJohn Bampton
https://github.com/rubygems/rubygems/commit/398bc1365e
2025-05-26Add shape_id to RBasic under 32 bitJohn Hawthorn
This makes `RBobject` `4B` larger on 32 bit systems but simplifies the implementation a lot. [Feature #21353] Co-authored-by: Jean Boussier <byroot@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/13341
2025-05-26[rubygems/rubygems] Bump the rb-sys group across 2 directories with 1 updatedependabot[bot]
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib directory: [rb-sys](https://github.com/oxidize-rb/rb-sys). Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example directory: [rb-sys](https://github.com/oxidize-rb/rb-sys). Updates `rb-sys` from 0.9.111 to 0.9.115 - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.111...v0.9.115) Updates `rb-sys` from 0.9.111 to 0.9.115 - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.111...v0.9.115) --- updated-dependencies: - dependency-name: rb-sys dependency-version: 0.9.115 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rb-sys - dependency-name: rb-sys dependency-version: 0.9.115 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rb-sys ... Signed-off-by: dependabot[bot] <support@github.com> https://github.com/rubygems/rubygems/commit/a7c0ff5641
2025-05-26[ruby/json] Fix: generate_json_float to reserve enough memory for large ↵Jean Boussier
negative floats. Fix: https://github.com/ruby/json/issues/807 Since https://github.com/ruby/json/pull/800, `fpconv_dtoa` can actually generate up to 28 chars. https://github.com/ruby/json/commit/d73ae93d3c
2025-05-23Change test to avoid stack overflow with MN threadsÉtienne Barrié
When using MN threads (such as running the test in a ractor), this test failed because it was raising a SystemStackError: stack level too deep. This is because the machine stack is smaller under MN threads than on the native main thread. Notes: Merged: https://github.com/ruby/ruby/pull/13427
2025-05-23Fix 'require' from a ractor when the required file raises an errorLuke Gruber
If you catch an error that was raised from a file you required in a ractor, that error did not have its belonging reset from the main ractor to the current ractor, so you hit assertion errors in debug mode. Notes: Merged: https://github.com/ruby/ruby/pull/13428
2025-05-23skip the test now we couldn't fixKoichi Sasada
The following error is reported repeatedly on my riscv64-linux machine, so just skipt it. I hope someone investigate it. ``` 1) Error: TestStruct::SubStruct#test_named_structs_are_not_rooted: Test::Unit::ProxyError: execution of Test::Unit::CoreAssertions#assert_no_memory_leak expired timeout (10 sec) pid 1113858 killed by SIGTERM (signal 15) | ruby 3.5.0dev (2025-05-22T21:05:12Z master 9583b7af8f) +PRISM [riscv64-linux] | | [7;1m1096282:1747967727.622:d70f:[mSTART={peak:453828608,size:453763072,lck:0,pin:0,hwm:9601024,rss:9601024,data:445943808,stk:135168,exe:4096,lib:7450624,pte:77824,swap:0} | [7;1m1096282:1747967727.622:d70f:[mFINAL={peak:457502720,size:457498624,lck:0,pin:0,hwm:13312000,rss:13312000,data:449679360,stk:135168,exe:4096,lib:7450624,pte:86016,swap:0} ``` Notes: Merged: https://github.com/ruby/ruby/pull/13422
2025-05-23Allow `IO#close` to interrupt IO operations on fibers using ↵Samuel Williams
`fiber_interrupt` hook. (#12839) Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2025-05-22[Bug #21357] Fix crash in Hash#merge with blockDaniel Colson
Prior to https://github.com/ruby/ruby/commit/49b306ecb9e2e9e06e0b1590bacc5f4b38169c3c the `optional_arg` passed from `rb_hash_update_block_i` to `tbl_update` was a hash value (i.e. a VALUE). After that commit it changed to an `update_call_args`. If the block sets or changes the value, `tbl_update_modify` will set the `arg.value` back to an actual value and we won't crash. But in the case where the block returns the original value we end up calling `RB_OBJ_WRITTEN` with the `update_call_args` which is not expected and may crash. `arg.value` appears to only be used to pass to `RB_OBJ_WRITTEN` (others who need the `update_call_args` get it from `arg.arg`), so I don't think it needs to be set to anything upfront. And `tbl_update_modify` will set the `arg.value` in the cases we need the write barrier. Notes: Merged: https://github.com/ruby/ruby/pull/13404
2025-05-21Use rb_inspect for Ractor errorJohn Hawthorn
Previously the object was used directly, which calls `to_s` if defined. We should use rb_inspect to get a value suitable for display to the programmer. Notes: Merged: https://github.com/ruby/ruby/pull/13389
2025-05-21Fix one-by-one error of numbered parameter IDRichard Böhme
Notes: Merged: https://github.com/ruby/ruby/pull/13395
2025-05-21[rubygems/rubygems] Copy prerelease attribute to dependency resolver setsNathan Ladd
https://github.com/rubygems/rubygems/commit/5956e7f8e5