summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-12-16Respect encoding of ID in exception messagesDaisuke Aritomo
2025-12-16Let Ractor::IsolationError report correct constant pathDaisuke Aritomo
Before this patch, Ractor::IsolationError reported an incorrect constant path when constant was found through `rb_const_get_0()`. In this code, Ractor::IsolationError reported illegal access against `M::TOPLEVEL`, where it should be `Object::TOPLEVEL`. ```ruby TOPLEVEL = [1] module M def self.f TOPLEVEL end end Ractor.new { M.f }.value ``` This was because `rb_const_get_0()` built the "path" part referring to the module/class passed to it in the first place. When a constant was found through recursive search upwards, the module/class which the constant was found should be reported. This patch fixes this issue by modifying rb_const_search() to take a VALUE pointer to be filled with the module/class where the constant was found. [Bug #21782]
2025-12-16[DOC] Harmonize rb_div methodsBurdetteLamar
2025-12-16ZJIT: Use rb_zjit_writebarrier_check_immediate() instead of ↵Benoit Daloze
rb_gc_writebarrier() in gen_write_barrier() * To avoid calling rb_gc_writebarrier() with an immediate value in gen_write_barrier(), and avoid the LIR jump issue.
2025-12-16Revert "ZJIT: Do not call rb_gc_writebarrier() with an immediate value in ↵Benoit Daloze
gen_write_barrier()" * This reverts commit 623559faa3dd0927b4034a752226a30ae8821604. * There is an issue with the jump in LIR, see https://github.com/ruby/ruby/pull/15542.
2025-12-16ZJIT: Add a VALUE#write_barrier helper method to deduplicate logicBenoit Daloze
2025-12-16ZJIT: Guard other calls to rb_gc_writebarrier() with a !special_const_p() checkBenoit Daloze
2025-12-16ZJIT: Do not call rb_gc_writebarrier() with an immediate value in ↵Benoit Daloze
gen_write_barrier()
2025-12-16Use RBIMPL_ASSERT_OR_ASSUME instead of ASSUME for better errors when it does ↵Benoit Daloze
not hold
2025-12-16gc.h: Reintroduce immediate guard in `rb_obj_written`Jean Boussier
This guard was removed in https://github.com/ruby/ruby/pull/13497 on the justification that some GC may need to be notified even for immediate. But the two currently available GCs don't, and there are plenty of assumtions GCs don't everywhere, notably in YJIT and ZJIT. This optimization is also not so micro (but not huge either). I routinely see 1-2% wasted there on micro-benchmarks. So perhaps if in the future we actually need this, it might make sense to introduce a way for GCs to declare that as an option, but in the meantime it's extra overhead with little gain.
2025-12-16YJIT: Print `Rc` strong and weak count on assert failureAlan Wu
For <https://bugs.ruby-lang.org/issues/21716>, the panic is looking like some sort of third party memory corruption, with YJIT taking the fall. At the point of this assert, the assembler has dropped, so there's nothing in YJIT's code other than JITState that could be holding on to these transient `PendingBranchRef`. The strong count being more than a handful or the weak count is non-zero shows that someone in the process (likely some native extension) corrupted the Rc's counts.
2025-12-16Revert "ZJIT: Allow ccalls above 7 arguments"Alan Wu
This reverts commit 2f151e76b5dc578026706b31f054d5caf5374b05. The SP decrement (push) before the call do not match up with the pops after the call, so registers were restored incorrectly. Code from: ./miniruby --zjit-call-threshold=1 --zjit-dump-disasm -e 'p Time.new(1992, 9, 23, 23, 0, 0, :std)' str x11, [sp, #-0x10]! str x12, [sp, #-0x10]! stur x7, [sp] # last argument mov x0, x20 mov x7, x6 mov x6, x5 mov x5, x4 mov x4, x3 mov x3, x2 mov x2, x1 ldur x1, [x29, #-0x20] mov x16, #0xccfc movk x16, #0x2e7, lsl #16 movk x16, #1, lsl #32 blr x16 ldr x12, [sp], #0x10 # supposed to match str x12, [sp, #-0x10]!, but got last argument ldr x11, [sp], #0x10
2025-12-16Make tracepoints with set_trace_func or TracePoint.new ractor local (#15468)Luke Gruber
Before this change, GC'ing any Ractor object caused you to lose all enabled tracepoints across all ractors (even main). Now tracepoints are ractor-local and this doesn't happen. Internal events are still global. Fixes [Bug #19112]
2025-12-16search_nonascii(): Replace UB pointer cast with memcpyAlan Wu
Casting a pointer to create an unaligned one is undefined behavior in C standards. Use memcpy to express the unaligned load instead to play by the rules. Practically, this yields the same binary output in many situations while fixing the crash in [Bug #21715].
2025-12-16add 21254 to the feature listAaron Patterson
2025-12-16Add the instance variable name and the module in Ractor::IsolationError (#15563)Étienne Barrié
2025-12-16Add the class variable and the class itself in Ractor::IsolationError (#15562)Étienne Barrié
2025-12-16Box: [DOC] Add RUBY_BOX in EnvironmentSatoshi Tagomori
2025-12-16Fix: Do not pass negative timeout to Addrinfo#connect_internal (#15578)Misaki Shioi
This change fixes a bug where, with `Socket.tcp`’s `fast_fallback option` disabled, specifying `open_timeout` could unintentionally pass a negative value to `Addrinfo#connect_internal`, `causing an ArgumentError`. ``` ❯ ruby -rsocket -e 'p Socket.tcp("localhost", 9292, open_timeout: 1, fast_fallback: false)' /Users/misaki-shioi/src/install/lib/ruby/4.0.0+0/socket.rb:64:in 'IO#wait_writable': time interval must not be negative (ArgumentError) sock.wait_writable(timeout) or ^^^^^^^ from /Users/misaki-shioi/src/install/lib/ruby/4.0.0+0/socket.rb:64:in 'Addrinfo#connect_internal' from /Users/misaki-shioi/src/install/lib/ruby/4.0.0+0/socket.rb:141:in 'Addrinfo#connect' from /Users/misaki-shioi/src/install/lib/ruby/4.0.0+0/socket.rb:964:in 'block in Socket.tcp_without_fast_fallback' from /Users/misaki-shioi/src/install/lib/ruby/4.0.0+0/socket.rb:231:in 'Array#each' from /Users/misaki-shioi/src/install/lib/ruby/4.0.0+0/socket.rb:231:in 'Addrinfo.foreach' from /Users/misaki-shioi/src/install/lib/ruby/4.0.0+0/socket.rb:945:in 'Socket.tcp_without_fast_fallback' from /Users/misaki-shioi/src/install/lib/ruby/4.0.0+0/socket.rb:671:in 'Socket.tcp' from -e:1:in '<main>' ```
2025-12-16Rename fiber_serial into ec_serialJean Boussier
Since it now live in the EC.
2025-12-16Store the fiber_serial in the EC to allow inliningJean Boussier
Mutexes spend a significant amount of time in `rb_fiber_serial` because it can't be inlined (except with LTO). The fiber struct is opaque the so function can't be defined as inlineable. Ideally the while fiber struct would not be opaque to the rest of Ruby core, but it's tricky to do. Instead we can store the fiber serial in the execution context itself, and make its access cheaper: ``` $ hyperfine './miniruby-baseline --yjit /tmp/mut.rb' './miniruby-inline-serial --yjit /tmp/mut.rb' Benchmark 1: ./miniruby-baseline --yjit /tmp/mut.rb Time (mean ± σ): 4.011 s ± 0.084 s [User: 3.977 s, System: 0.011 s] Range (min … max): 3.950 s … 4.245 s 10 runs Benchmark 2: ./miniruby-inline-serial --yjit /tmp/mut.rb Time (mean ± σ): 3.495 s ± 0.150 s [User: 3.448 s, System: 0.009 s] Range (min … max): 3.340 s … 3.869 s 10 runs Summary ./miniruby-inline-serial --yjit /tmp/mut.rb ran 1.15 ± 0.05 times faster than ./miniruby-baseline --yjit /tmp/mut.rb ``` ```ruby i = 10_000_000 mut = Mutex.new while i > 0 i -= 1 mut.synchronize { } mut.synchronize { } mut.synchronize { } mut.synchronize { } mut.synchronize { } mut.synchronize { } mut.synchronize { } mut.synchronize { } mut.synchronize { } mut.synchronize { } end ```
2025-12-16Box: fix the class name in testsNobuyoshi Nakada
2025-12-16Box: [DOC] fix the class name in rdocNobuyoshi Nakada
Also remove a stale TODO.
2025-12-16Box: fix the class name in inspectNobuyoshi Nakada
2025-12-16Box: fix the environment variable nameNobuyoshi Nakada
2025-12-16Box: move extensions from namespace to boxNobuyoshi Nakada
2025-12-16Revert "[Feature #6012] Extend `source_location` for end positionNobuyoshi Nakada
and columns" This reverts commit 073c4e1cc712064e626914fa4a5a8061f903a637. https://bugs.ruby-lang.org/issues/6012#note-31 > we will cancel this feature in 4.0 because of design ambiguities > such as whether to return column positions in bytes or characters as > in [#21783]. [#21783]: https://bugs.ruby-lang.org/issues/21783
2025-12-16[ruby/rubygems] Added assertion for Windows and nmakeHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/be5c4e27d9
2025-12-16[ruby/rubygems] Reset MAKEFLAGS option for build jobs testsHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/09e6031a11
2025-12-16[ruby/rubygems] Allow to specify the number of `make` jobs when installing gems:Edouard CHIN
- Added a new `-j` option to `gem install` and `gem update`. This option allows to specify the number of jobs we pass to `make` when compiling gem with native extensions. By default its the number of processors, but users may want a way to control this. You can use it like so: `gem install json -j8` https://github.com/ruby/rubygems/commit/67aad88ca6
2025-12-16[ruby/rubygems] Pass down value of `BUNDLE_JOBS` to RubyGems before compiling:Edouard CHIN
- ### Problem Since https://github.com/ruby/rubygems/pull/9131, we are now compiling make rules simultaneously. The number of jobs is equal to the number of processors. This may be problematic for some users as they want to control this value. ### Solution The number of jobs passed to `make` will now be equal to the `BUNDLE_JOBS` value. ### Side note It's also worth to note that since Bundler installs gems in parallel, we may end up running multiple `make -j<JOB>` in parallel which would cause exhaust the number of processors we have. This problem can be fixed by implementing a GNU jobserver, which I plan to do. But I felt that this would be too much change in one PR. https://github.com/ruby/rubygems/commit/d51995deb9
2025-12-15YJIT: Bail out if proc would be stored above stack topRandy Stauner
Fixes [Bug #21266].
2025-12-16[ruby/rubygems] Fix quote handling in mise format ruby version parsinghituzi no sippo
The previous regex didn't properly match quoted strings it would capture the opening quote as part of the version if quotes were mismatched. This change properly parses double-quoted, single-quoted, and unquoted version strings separately. https://github.com/ruby/rubygems/commit/81e48c8185
2025-12-16[ruby/rubygems] Support single quotes in mise format ruby versionhituzi no sippo
https://github.com/ruby/rubygems/commit/a7d7ab39dd
2025-12-15ZJIT: Fix test failures from line number of `Primitive` shiftingAlan Wu
This can happen with documentation updates and we don't want those to trip on ZJIT tests. Redact the whole name since names like "_bi342" aren't that helpful anyways.
2025-12-16[ruby/rubygems] Allow to show cli_help with bundler executableHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/a091e3fd10
2025-12-15Bump actions/cache in /.github/actions/setup/directoriesdependabot[bot]
Bumps [actions/cache](https://github.com/actions/cache) from 5.0.0 to 5.0.1. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/a7833574556fa59680c1b7cb190c1735db73ebf0...9255dc7a253b0ccc959486e2bca901246202afeb) --- updated-dependencies: - dependency-name: actions/cache dependency-version: 5.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15[DOC] Remove copyright from Set class docsPeter Zhu
2025-12-16[ruby/rubygems] Tweak the Bundler's "X gems now installed message":Edouard CHIN
- Fix https://github.com/ruby/rubygems/pull/9188 - This message is a bit misleading because it always outputs one extra specs, which is Bundler itself. This is now fixed when the message is about to be output. https://github.com/ruby/rubygems/commit/70b4e19506
2025-12-16[ruby/rubygems] Allow bundle pristine to work for git gems in the same repo:Edouard CHIN
- Fix https://github.com/ruby/rubygems/pull/9186 - ### Problem Running `bundle pristine` in a Gemfile where there is many git gem pointing to the same repository will result in a error "Another git process seems to be running in this repository". ### Context This error is a regression since https://github.com/ruby/rubygems/commit/a555fd6ccd17 where `bundle pristine` now runs in parallel which could lead to running simultaneous git operations in the same repository. ### Solution When Bundler pristine a git gem it does a `git reset --hard` without specifying a path. This means the whole repository will be reset. In this case, we can leverage that by just pristining one gem per unique git sources. This is also more efficient. https://github.com/ruby/rubygems/commit/710ba514a8
2025-12-15Point people to redmine on ZJIT docs (#15499)Max Bernstein
Fix https://github.com/Shopify/ruby/issues/900
2025-12-15[ruby/psych] Check that Data members match exactlyBenoit Daloze
* Fixes https://github.com/ruby/psych/issues/760 https://github.com/ruby/psych/commit/952008c898
2025-12-15[ruby/psych] Replace C extension with Data#initialize bind_callnick evans
https://github.com/ruby/psych/commit/6a826693ba
2025-12-15[DOC] Harmonize #-@ methodsBurdetteLamar
2025-12-15[DOC] Harmonize #- methodsBurdetteLamar
2025-12-15[DOC] Harmonize #** methodsBurdetteLamar
2025-12-15Revert "Fix Socket.tcp cleanup after Thread#kill (#15131)" (#15565)Luke Gruber
This reverts commit 3038286a4bf7832f1c42c8cc9774ee6ff19876fc. The following CI failure scared me: https://github.com/ruby/ruby/actions/runs/20241051861/job/58108997049 ``` 1) Timeout: TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback ``` Since it could be related, I'm reverting this for now.
2025-12-15Update default gems list at adf676c530b5da2822aa3b03ee43e5 [ci skip]git
2025-12-15[ruby/erb] Version 6.0.1Takashi Kokubun
https://github.com/ruby/erb/commit/bbde68fcd5
2025-12-15[ruby/erb] Freeze ERB::Compiler::TrimScanner::ERB_STAGDaisuke Aritomo
(https://github.com/ruby/erb/pull/100) For Ractor compatibility. https://github.com/ruby/erb/commit/43f0876595