summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-03-16v4.0.2v4.0.2Takashi Kokubun
2026-03-16Bump Prism to v1.8.1Takashi Kokubun
2026-03-16[ruby/prism] Fix not binding power in endless methods [Backport #21097]Takashi Kokubun
Change rescue modifier binding power from PM_BINDING_POWER_COMPOSITION to PM_BINDING_POWER_MATCH + 1, so that `x = a rescue b in c` is parsed as `(x = (a rescue b)) in c` and `def f = a rescue b in c` is parsed as `(def f = (a rescue b)) in c`. https://github.com/ruby/prism/commit/7e797f59ae
2026-03-16Update pstore to 0.2.1 [Backport #21880]Takashi Kokubun
Fix ultra_safe mode of pstore bundled with Ruby 4.0.
2026-03-16merge revision(s) 08372635f7ec09f7115bd254246ebd637499651c: [Backport #21926]Takashi Kokubun
Fix race condition right after ubf registration Fixes [Bug #21926]
2026-03-16merge revision(s) f315d250b44e75a1a69f4a05b293dcc701377689: [Backport #21947]Takashi Kokubun
[ruby/timeout] Compatibility with Fiber scheduler. (https://github.com/ruby/timeout/pull/97) [Bug #21947]
2026-03-16merge revision(s) 55694ad7efc3f8dc6d5c7aefa60ded4c303ed6cf: [Backport #21945]Takashi Kokubun
[Bug #21945] Correctly handle `and?` and similar
2026-03-16merge revision(s) 361644c0cce3235e9cc6724994c6b5711deb10b8: [Backport #21917]Takashi Kokubun
[PATCH] [Bug #21917] Fix build on AIX
2026-03-16YJIT: Fix not reading locals from `cfp->ep` after `YJIT.enable` and ↵Alan Wu
exceptional entry [Backport #21941] In case of `--yjit-disable`, YJIT only starts to record environment escapes after `RubyVM::YJIT.enable`. Previously we falsely assumed that we always have a full history all the way back to VM boot. This had YJIT install and run code that assume EP=BP when EP≠BP for some exceptional entry into the middle of a running frame, if the environment escaped before `YJIT.enable`. The fix is to reject exceptional entry with an escaped environment. Rename things and explain in more detail how the predicate for deciding to assume EP=BP works. It's quite subtle since it reasons about all parties in the system that push a control frame and then run JIT code. Note that while can_assume_on_stack_env() checks the currently running environment if it so happens to be the one YJIT is compiling against, it can return true for any ISEQ. The check isn't necessary for fixing the bug, and the load bearing part of this patch is the change to exceptional entries. This fix is flat on speed and space on ruby-bench headline benchmarks. Many thanks for the community effort to create a small test case for this bug.
2026-03-11Windows: Explicitly specify the use of `coreutils` commandsNobuyoshi Nakada
It appears that shims for individual commands are no longer being created.
2026-03-11Use $LOAD_PATH.replace for safer restoration in testHiroshi SHIBATA
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11Suppress bundled gems warning for subfeatures found outside stdlib [Bug #21828]Hiroshi SHIBATA
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11Fix M:N threads under OpenBSDJohn Hawthorn
OpenBSD requires MAP_STACK for memory regions used as thread stacks. However it seems to error with "Invalid argument" unless the permissions include both PROT_READ | PROT_WRITE. We should be able to satisft this by re-mmapping over our reserved stack region to get the MAP_STACK flag. As a (very minor) bonus, this applies MAP_STACK only to the machine stack region, not the VM region. Co-authored-by: Jeremy Evans <code@jeremyevans.net>
2026-03-09Lock to install uutils-coreutils@0.5.0Hiroshi SHIBATA
2026-03-09Merge zlib-3.2.3Hiroshi SHIBATA
2026-03-06[ruby/prism] Fix in handlingKevin Newton
in is a unique keyword because it can be the start of a clause or an infix keyword. We need to be explicitly sure that even though in _could_ close an expression context (the body of another in clause) that we are not also parsing an inline in. The exception is the case of a command call, which can never be the LHS of an expression, and so we must immediately exit. [Bug #21925] [Bug #21674] https://github.com/ruby/prism/commit/20374ced51
2026-03-06[ruby/prism] Fix error message for block/lambda with `...` argumentEarlopain
They currently complain that the parent method is not forwarding. But the actual problem is that these types of arguments simply don't accept `...` Fixes [Bug #21927] https://github.com/ruby/prism/commit/0aa2363331
2026-03-06[ruby/prism] Correctly handle `and?` and similar on ruby 4.0Earlopain
It gets confused for syntax introduced in https://bugs.ruby-lang.org/issues/20925 But it actually should be a plain method call. `!`/`?` are not valid as part of an identifier, methods however allow them as the last character. Fixes [Bug #21946] https://github.com/ruby/prism/commit/5d80bc5e1a
2026-03-05Map M:N thread stack chunks initially as PROT_NONEJohn Hawthorn
Previously we initially mapped the full 512MB chunk as PROT_READ|PROD_WRITE and then set a guard page to PROT_NONE the first time a new thread stack is needed. Usually that's okay as we don't touch that memory until it is needed and so it doesn't count towards RSS. However, on Linux even with vm.overcommit_memory=0 (the default) if on a system (like a tiny cloud VM) with <512MB of RAM+swap that would error with. Thread#initialize': can't create Thread: Cannot allocate memory (ThreadError) This changes the chunk to be mapped initially with PROT_NONE, then instead of mapping the guard pages we map in the machine and VM stacks using mprotect. This ensures we don't commit stack memory until it is first used, and as a side benefit any stray pointers into unused stack should segfault. When a stack is freed/reused there is no change from the previous behaviour, we just use madvise and leave the same regions in place. [Bug #21944]
2026-03-03string.c: guard tmp in rb_str_format_m (GH-16280)ZHIJIE XIE
[Bug #21931] Keep tmp alive while RARRAY_CONST_PTR(tmp) is used by rb_str_format. [alan: sunk the guard below usage] Reviewed-by: Alan Wu <XrXr@users.noreply.github.com>
2026-02-12Use Oregon mirror for cygwin downloadHiroshi SHIBATA
2026-02-12Fix bundled gems warning for all subfeatures of hyphenated gemsChris Hasiński
PR #15822 fixed the warning for direct hyphenated gem requires like `benchmark/ips` → `benchmark-ips`. However, hyphenated gems often provide multiple files under their namespace. For example, `benchmark-ips` provides: - benchmark/ips.rb - benchmark/timing.rb - benchmark/compare.rb When requiring `benchmark/timing`, the previous fix only checked for `benchmark-timing` gem (doesn't exist), not `benchmark-ips` which actually provides the file. This fix checks if ANY gem matching `{prefix}-*` is in the bundle specs, which covers all subfeatures provided by hyphenated gems. Reported in https://github.com/ruby/ruby/pull/15822#issuecomment-123456
2026-02-10ZJIT: Avoid runtime exceptions from RubyVM::ZJIT.stats_string (#16139)Takashi Kokubun
Before this it would raise if zjit wasn't enabled and raise a different exception if zjit was but extended stats were not (_some_ stats are available). Co-authored-by: Randy Stauner <randy@r4s6.net>
2026-02-10Fix UnboundMethod#== for methods from included/extended modules [Backport ↵Mike Dalessio
#21873] Method#unbind clones the method entry, preserving its defined_class. For methods mixed in via include/extend, defined_class is an ICLASS, causing UnboundMethod#== to return false when comparing against the same method obtained via Module#instance_method. Resolve ICLASS defined_class in method_eq. [Bug #21873]
2026-02-09Merge RubyGems/Bundler 4.0.6Hiroshi SHIBATA
2026-02-09Merge RubyGems/Bundler 4.0.5Hiroshi SHIBATA
2026-02-09Merge RubyGems/Bundler 4.0.4Hiroshi SHIBATA
2026-02-09merge revision(s) 8a586af33b59cae93a1bee13c39e87dd087a4a6b: [Backport #21838]Takashi Kokubun
[PATCH] Don't force major GC when there are allocatable slots [Bug #21838] When we have allocatable slots, we can grow the heap instead of forcing a major GC. This prevents major GC to be ran very often in certain situations. See the ticket for more details. On ruby-bench, we can see that this patch doesn't cause any significant regressions: -------------- ----------- ---------- --------- ----------- ---------- --------- -------------- ------------- bench master (ms) stddev (%) RSS (MiB) branch (ms) stddev (%) RSS (MiB) branch 1st itr master/branch activerecord 148.2 0.3 59.2 150.0 0.8 69.7 1.015 0.988 chunky-png 435.2 0.3 72.9 438.8 0.1 66.7 0.993 0.992 erubi-rails 733.8 1.2 118.7 704.8 0.2 98.3 1.077 1.041 hexapdf 1400.4 1.1 247.0 1405.0 0.9 223.7 0.986 0.997 liquid-c 32.5 3.3 32.8 32.5 2.1 30.7 1.042 0.999 liquid-compile 31.0 1.7 35.1 33.4 3.9 32.8 0.938 0.928 liquid-render 84.7 0.4 30.8 86.3 0.4 30.8 0.981 0.982 lobsters 594.7 0.6 310.5 596.6 0.4 306.0 1.057 0.997 mail 75.6 2.8 53.3 76.9 0.7 53.2 0.968 0.982 psych-load 1122.8 1.2 29.2 1145.1 0.4 31.7 0.964 0.981 railsbench 1244.7 0.3 115.5 1254.8 1.1 115.2 0.939 0.992 rubocop 103.7 0.5 94.1 104.3 0.5 92.4 0.985 0.994 ruby-lsp 88.3 0.6 78.5 88.5 1.2 77.9 0.992 0.997 sequel 26.9 0.9 33.6 28.3 1.4 32.1 0.954 0.952 shipit 1119.3 1.5 171.4 1075.7 2.1 162.5 1.873 1.040 -------------- ----------- ---------- --------- ----------- ---------- --------- -------------- -------------
2026-02-09merge revision(s) 78b7646bdb91285873ac26bca060591e06c45afe, ↵Takashi Kokubun
b4a62a1ca949d93332ad8bce0fcc273581160cc5: [Backport #21842] [PATCH] [Bug #21842] Let `rb_interned_str` return US-ASCII if possible [PATCH] [DOC] Update docs for rb_interned_str and related functions (#15897) Related to [Bug #21842]. * rb_interned_str: document what decides whether the returned string is in US-ASCII or BINARY encoding. * rb_interned_str_cstr: include the same description as rb_interned_str for the encoding. This one was still missing the update for US-ASCII and erroneously said the returned string was alwasy in BINARY encoding * rb_str_to_interned_str: document how the encoding of the result is defined. Co-authored-by: Herwin <herwinw@users.noreply.github.com>
2026-02-09Fix signal crash during keyword argument callJohn Hawthorn
64f508ade8 changed rb_threadptr_raise to call rb_exception_setup, which uses rb_scan_args with RB_SCAN_ARGS_PASS_CALLED_KEYWORDS. This checked rb_keyword_given_p(), which read the interrupted frame's keyword state rather than the signal raise arguments, causing a crash when a signal arrived during a keyword call. Revert rb_threadptr_raise to use rb_make_exception directly, and have thread_raise_m call rb_exception_setup where rb_keyword_given_p() reflects the correct frame. [Bug #21865]
2026-02-09[Backport #21866] Fix integer overflow checks in enumerator (#16088)Randy Stauner
Fix integer overflow checks in enumerator Co-authored-by: Jörmungandrk <github@zerodaysec.org>
2026-01-21[ruby/syntax_suggest] v2.0.3Earlopain
https://github.com/ruby/syntax_suggest/commit/a81b92fcf2 [Bug #21847]
2026-01-21[ruby/syntax_suggest] Refactor multi-prism version logicSchneems
The reason this logic for different methods branches in the class instead of internally was to be eagerly aggressive about runtime performance. This code is currently only used once for the document where it's invoked ~N times (where N is number of lines): ```ruby module SyntaxSuggest class CleanDocument # ... def join_trailing_slash! trailing_groups = @document.select(&:trailing_slash?).map do |code_line| take_while_including(code_line.index..) { |x| x.trailing_slash? } end join_groups(trailing_groups) self end ``` Since this is not currently a hot-spot I think merging the branches and using a case statement is a reasonable tradeoff and avoids the need to do specific version testing. An alternative idea was presented in #241 of behavior-based testing for branch logic (which I would prefer), however, calling the code triggered requiring a `DelegateClass` when the `syntax_suggest/api` is being required. https://github.com/ruby/syntax_suggest/commit/ab122c455f
2026-01-21[ruby/syntax_suggest] Handle `on_sp` when using prismEarlopain
It used to not emit this token type, but now it does. So when a newer version of prism is present, we can fall back to the same code that ripper uses. Ref: * https://github.com/ruby/ruby/pull/15914 * https://github.com/ruby/prism/pull/3859 https://github.com/ruby/syntax_suggest/commit/42a3b8f6cb
2026-01-20Restore irb to warning targetHiroshi SHIBATA
Users should add `irb` to their Gemfile. `Gem::BUNDLED_GEMS.force_activate 'irb'` is workaround for short term.
2026-01-20Suppress bundled gem warning on `binding.irb'Daisuke Aritomo
This patch silences the "this won't work in the next version of Ruby" warning displayed when irb is autoloaded via `binding.irb`. main.rb:1: warning: irb used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0. You can add irb to your Gemfile or gemspec to fix this error. /.../irb.rb:9: warning: reline used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0. You can add reline to your Gemfile or gemspec to fix this error. From: main.rb @ line 1 : => 1: binding.irb /.../input-method.rb:284: warning: rdoc used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0. You can add rdoc to your Gemfile or gemspec to fix this error. This warning is incorrect and misleading: users should not need to include irb (and its dependencies) to their Gemfiles to use `binding.irb`, even in future versions of Ruby. It is agreed that the runtime takes care of that.
2026-01-20Added example for bundle/inlineHiroshi SHIBATA
2026-01-20Add commentsDaisuke Aritomo
2026-01-20Fake BUNDLE_GEMFILE and BUNDLE_LOCKFILE to let checks passDaisuke Aritomo
Bundler::Runtime#setup requires a real existing lockfile (see Bundler::SharedHelpers#default_lockfile).
2026-01-20[Bug #21723] Let `binding.irb` properly load irb by fixing force_activate()Daisuke Aritomo
This patch fixes a problem where `binding.irb` (= force_activate('irb')) fails under `bundle exec` when the Gemfile does not contain `irb` and does contain a gem which is (1) not installed in GEM_HOME (2) sourced using `path:`/`git:`. The original approach constructing a temporary definition fails since it does not set the equalivent of `path:`/`git:`. Always reconstructing a definition from a Gemfile and applying lockfile constraints should be a more robust approach. [Bug #21723]
2026-01-14[Backport #21832] Add pushtoarray insn to fix segfault with forwarding + ↵Randy Stauner
splat (#15870) Add pushtoarray insn to fix segfault with forwarding + splat Example insns diff for `def x = [3]; def a(...) = b(*x, 2, 3, ...)` == disasm: #<ISeq:a@-e:1 (1,13)-(1,42)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 1] "..."@0 0000 putself ( 1)[Ca] 0000 putself 0000 opt_send_without_block <calldata!mid:x, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0000 splatarray true 0000 putobject 2 0000 putobject 3 +0000 pushtoarray 2 0000 getlocal_WC_0 "..."@0 0000 sendforward <calldata!mid:b, argc:1, ARGS_SPLAT|ARGS_SPLAT_MUT|FCALL|FORWARDING>, nil 0000 leave [Re] This matches the insns produced by parse.y
2026-01-13Add a test backport missed at a10f7fac1fb1dcbdb1ae41137bd7294764a34793Takashi Kokubun
https://bugs.ruby-lang.org/issues/21831
2026-01-12v4.0.1v4.0.1Takashi Kokubun
2026-01-12Sync Prism to 1.8.0Takashi Kokubun
2026-01-12merge revision(s) 7e81bf5c0c8f43602e6d901f4253dca2f3d71745: [Backport #21812]Takashi Kokubun
[PATCH] Fix sleep spurious wakeup from sigchld (#15802) When sleeping with `sleep`, currently the main thread can get woken up from sigchld from any thread (subprocess exited). The timer thread wakes up the main thread when this happens, as it checks for signals. The main thread then executes the ruby sigchld handler if one is registered and is supposed to go back to sleep immediately. This is not ideal but it's the way it's worked for a while. In commit 8d8159e7d8 I added writes to `th->status` before and after `wait_running_turn` in `thread_sched_to_waiting_until_wakeup`, which is called from `sleep`. This is usually the right way to set the thread's status, but `sleep` is an exception because the writes to `th->status` are done in `sleep_forever`. There's a loop that checks `th->status` in `sleep_forever`. When the main thread got woken up from sigchld it saw the changed `th->status` and continued to run the main thread instead of going back to sleep. The following script shows the error. It was returning instead of sleeping forever. ```ruby t = Thread.new do sleep 0.3 `echo hello` # Spawns subprocess puts "Subprocess exited" end puts "Main thread sleeping..." result = sleep # Should block forever puts "sleep returned: #{result.inspect}" ``` Fixes [Bug #21812]
2026-01-12merge revision(s) d7a6ff8224519005d2deeb3f4e98689a8a0835ad: [Backport #21819]Takashi Kokubun
[PATCH] [Bug #21819] Data objects without members should also be frozen
2026-01-12merge revision(s) 9824724b2ffe583302e9318c6eff7a440478125f: [Backport #21815]Takashi Kokubun
[PATCH] Skip test_write_binary(GemSingletonTest) at rbs tests ``` Errno::EACCES: Permission denied @ rb_file_s_rename ... D:/a/ruby/ruby/src/lib/rubygems/util/atomic_file_writer.rb:42:in 'File.rename' ``` It may caused with atomic_file_writer.rb
2026-01-12merge revision(s) 19e539c9ee1701b34189fa0c1feb942adeb0e326: [Backport #21814]Takashi Kokubun
[PATCH] [Bug #21814] Fix negative bignum modulo If modulo is zero, do not apply bias even if the divisor is zero. `BIGNUM_POSITIVE_P` is true even on bignum zero.
2026-01-12merge revision(s) 4e0bb58a0a374b40b7691e7b7aa88e759a0fc9f2: [Backport #21811]Takashi Kokubun
[PATCH] fix underflow
2026-01-12Remove ruby-bench excludesStan Lo
These benchmarks should be working fine now.