summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-03-11Bump v3.4.9v3_4_9nagachika
2026-03-07Bump zlib version to 3.2.3.nagachika
2026-03-07Fix 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-03-07objspace_dump: Skip invalid CME when dumping CCsJohn Hawthorn
When a CC is invalidated only the klass field is set to 0. After it's invalidated it isn't safe to access the CME, as it may have been freed. I made a similar change in Ruby 4.0 in 640a2f1dc77c0ecf226dbd71cf7a1eb876a1f037, but assumed it was due to the changes we'd made to callcaches making klass a weak-reference. Co-authored-by: Christian Bruckmayer <christian.bruckmayer@shopify.com>
2026-03-07[3.4] Fix deadlock on th->interrupt_lock after forkJean Boussier
[Bug #21860] If a thread was holding this lock before fork, it will not exist in the child process. We should re-initialize these locks as we do with the VM locks when forking. Co-Authored-By: John Hawthorn <john@hawthorn.email> Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2026-03-07Fix integer overflow checks in enumeratorJörmungandrk
2026-03-05string.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-01-25merge revision(s) 8a586af33b59cae93a1bee13c39e87dd087a4a6b: [Backport #21838]nagachika
[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-01-25Add pushtoarray insn to fix segfault with forwarding + splatRandy Stauner
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-25merge revision(s) 4e0bb58a0a374b40b7691e7b7aa88e759a0fc9f2: [Backport #21811]nagachika
[PATCH] fix underflow
2026-01-25merge revision(s) d7a6ff8224519005d2deeb3f4e98689a8a0835ad: [Backport #21819]nagachika
[PATCH] [Bug #21819] Data objects without members should also be frozen
2026-01-25merge revision(s) 19e539c9ee1701b34189fa0c1feb942adeb0e326: [Backport #21814]nagachika
[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-25merge revision(s) 86320a53002a3adaf35ad7434c70e86747a8b345: [Backport ↵nagachika
#21326] [Backport #21807] [PATCH] Fix compilation for forwarding params in Prism [Bug #21326]
2026-01-25merge revision(s) 61bab1889048f758396acf671c9797d6bc52504b: [Backport #21757]nagachika
[PATCH] Rename to `struct rbimpl_size_overflow_tag` This struct is used for addition not only for multiplication, so remove the word `mul`, and make the member names more descriptive.
2026-01-25merge revision(s) 99ff0224a564b59df3ba8fbd7911dd41a7fdde34: [Backport #21757]nagachika
[PATCH] Move rbimpl_size_add_overflow from gc.c to memory.h
2026-01-25merge revision(s) f430fbbfacea5690d790dd9060ca4118431fc2fb, ↵nagachika
c353b625297162024b5a80480664e599dd49a294: [Backport #21787] [PATCH] IO::Buffer: Fill the test for `IO::Buffer#clear` [PATCH] [Bug #21787] IO::Buffer: Check addition overflows https://hackerone.com/reports/3437743
2026-01-21merge revision(s) d209e6f1c0a93ad3ce1cc64dd165a6b67672614d: [Backport #21715]Hiroshi SHIBATA
[PATCH] search_nonascii(): Replace UB pointer cast with memcpy 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].
2026-01-05Remove k0kubun from CODEOWNERSTakashi Kokubun
nagachika will take over the maintenance of ruby_3_4 going forward.
2025-12-16make-snapshot: Fix Psych::DisallowedClass with newer psychTakashi Kokubun
``` $ tool/format-release ../www.ruby-lang.org 4.0.0-preview2 . /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/class_loader.rb:99:in 'Psych::ClassLoader::Restricted#find': Tried to load unspecified class: Date (Psych::DisallowedClass) from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/class_loader.rb:28:in 'Psych::ClassLoader#load' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/class_loader.rb:40:in 'Psych::ClassLoader#date' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/scalar_scanner.rb:65:in 'Psych::ScalarScanner#tokenize' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:65:in 'Psych::Visitors::ToRuby#deserialize' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:129:in 'Psych::Visitors::ToRuby#visit_Psych_Nodes_Scalar' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/visitor.rb:30:in 'Psych::Visitors::Visitor#visit' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/visitor.rb:6:in 'Psych::Visitors::Visitor#accept' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:35:in 'Psych::Visitors::ToRuby#accept' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:346:in 'block in Psych::Visitors::ToRuby#revive_hash' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:344:in 'Array#each' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:344:in 'Enumerable#each_slice' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:344:in 'Psych::Visitors::ToRuby#revive_hash' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:168:in 'Psych::Visitors::ToRuby#visit_Psych_Nodes_Mapping' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/visitor.rb:30:in 'Psych::Visitors::Visitor#visit' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/visitor.rb:6:in 'Psych::Visitors::Visitor#accept' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:35:in 'Psych::Visitors::ToRuby#accept' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:339:in 'block in Psych::Visitors::ToRuby#register_empty' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:339:in 'Array#each' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:339:in 'Psych::Visitors::ToRuby#register_empty' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:147:in 'Psych::Visitors::ToRuby#visit_Psych_Nodes_Sequence' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/visitor.rb:30:in 'Psych::Visitors::Visitor#visit' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/visitor.rb:6:in 'Psych::Visitors::Visitor#accept' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:35:in 'Psych::Visitors::ToRuby#accept' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:319:in 'Psych::Visitors::ToRuby#visit_Psych_Nodes_Document' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/visitor.rb:30:in 'Psych::Visitors::Visitor#visit' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/visitor.rb:6:in 'Psych::Visitors::Visitor#accept' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych/visitors/to_ruby.rb:35:in 'Psych::Visitors::ToRuby#accept' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych.rb:336:in 'Psych.safe_load' from /opt/rubies/3.4.6/lib/ruby/3.4.0/psych.rb:371:in 'Psych.load' from tool/format-release:80:in 'Tarball.parse' from tool/format-release:269:in 'Object#main' from tool/format-release:272:in '<main>' ```
2025-12-16v3.4.8v3_4_8Takashi Kokubun
2025-12-16merge revision(s) 9168cad4d63a5d281d443bde4edea6be213b0b25: [Backport #21266]Takashi Kokubun
[PATCH] YJIT: Bail out if proc would be stored above stack top Fixes [Bug #21266].
2025-12-16merge revision(s) bc2a8a002a6c41fc1b28e02e15e2fb2b72d1b66e, ↵Takashi Kokubun
c26057ebafb23b063190d31d5b4d19a0e0a1306c: [Backport #21779] [PATCH] [Bug #21779] Uniquify `InitVM` functions as well as `Init` Avoid possible name conflict when `--with-static-linked-ext`. [PATCH] [Bug #21779] Do not export InitVM functions Fix ruby/io-console#105.
2025-12-16merge revision(s) 1e7cf7b2bc1f9b356b2e980e1e18548618da6363: [Backport #21446]Takashi Kokubun
[PATCH] Fix refinement modification of method visibility in superclass Previously, this didn't work correctly, resulting in a SystemStackError. This fixes the issue by finding the related superclass method entry, and updating the orig_me in the refinement method to point to the superclass method. Fixes [Bug #21446]
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-12YJIT: Fix panic from overly loose filtering in identity method inliningAlan Wu
Credits to @rwstauner for noticing this issue in GH-15533.
2025-12-12YJIT: Add missing local variable type update for fallback setlocal blocksAlan Wu
Previously, the chain_depth>0 version of setlocal blocks did not update the type of the local variable in the context. This can leave the context with stale type information and trigger or lead to miscompilation. To trigger the issue, YJIT needs to see the same ISEQ before and after environment escape and have tracked type info before the escape. To trigger in ISEQs that do not send with a block, it probably requires Kernel#binding or the use of include/ruby/debug.h APIs. [Backport #21772]
2025-12-12Fix allocationless anonymous splat keyword argument checkJeremy Evans
Previously, if an argument splat and keywords are provided by the caller, it did not check whether the method/proc accepted keywords before avoiding the allocation. This is incorrect, because if the method/proc does not accept keywords, the keywords passed by the caller are added as a positional argument, so there must be an allocation to avoid mutating the positional splat argument. Add a check that if the caller passes keywords, the method/proc must accept keywords in order to optimize. If the caller passes a keyword splat, either the method/proc must accept keywords, or the keyword splat must be empty in order to optimize. If keywords are explicitly disallowed via `**nil`, the optimization should be skipped, because the array is mutated before the ArgumentError exception is raised. In addition to a test for the correct behavior, add an allocation test for a method that accepts an anonymous splat without keywords. Fixes [Bug #21757]
2025-12-08Interpolation with only string literals must not be frozenEarlopain
Basically a redo of https://github.com/ruby/ruby/commit/a1403fb7cbd1fe0df97c932be9814c86081783dc but respecting the frozen string literal magic comment Fixes [Bug #21187]
2025-12-08Interpolated strings must not be frozenAaron Patterson
Strings concatenated with backslash may end up being frozen when they shouldn't be. This commit fixes the issue. It required a change upstream in Prism, but also a change to the Prism compiler in CRuby. https://github.com/ruby/prism/pull/3606 [Bug #21187]
2025-12-08Bump Prism to v1.5.2Takashi Kokubun
[Backport #21187]
2025-12-08merge revision(s) 0b0da6c4b26f80ad6985722d3fc0f5cdee09125d: [Backport #21648]Takashi Kokubun
[PATCH] Correctly compile splats in for-loop index in prism Fixes [Bug #21648] This is a followup to https://github.com/ruby/ruby/pull/13597. The added test passed but didn't emit the same instructions. This also handles bare splats and aligns instructions for all cases
2025-12-08merge revision(s) beb85e7eeee4163cd45b69645a60cdb942f72c05: [Backport #21705]Takashi Kokubun
[PATCH] [Bug #21705] Fix segfaults on Windows It should check the type of the argument and coercion before converting the encoding.
2025-12-08merge revision(s) f4f728b319086eea3db6e9909fb9c849c276f813: [Backport #21680]Takashi Kokubun
[PATCH] [Bug #21680] Fix (base**power_of_two).digits(base) bug (#15144) Fix wrong condition in base multiplying loop.
2025-12-08merge revision(s) a4dff09be79b52288a47658964d25e5aa84fc960: [Backport #21265]Takashi Kokubun
[PATCH] [Bug #21673] Fix resolving refined module-defined method A method defined in a module has no `defined_class`, use the ICLASS for it as the `defined_class`.
2025-12-08merge revision(s) 9d44cb0b2b5520b2b299851003ca2a97bf1e2079, ↵Takashi Kokubun
367ddd445cdf5ccc55a0481c944746ef595f72f7, 48dce7874fcb571765635b32fa6a3e3a12e228f8: [Backport #21655] [PATCH] Remove rbimpl_rstring_getmem() usage as workaround for GCC 15.2.1 optimization bug. [Bug #21655] [PATCH] include/ruby/internal/core/rstring.h: Remove rbimpl_rstring_getmem() definition. [PATCH] simplify RSRING_GETMEM() definition.
2025-12-08merge revision(s) c5bd4acd30320a8e180ce9fcb24acdab4e10c73a: [Backport #21666]Takashi Kokubun
[PATCH] [Bug #21666] Get rid of use of unspecified values
2025-12-08merge revision(s) 190b017fc6c21ff7b61c2b5ece0294785e4a4ca2: [Backport #21703]Takashi Kokubun
[PATCH] Don't use non blocking pipes for RUBY_CRASH_REPORT [Bug #21703] RUBY_CRASH_REPORT does not work in some cases when shelling out on Linux. For example, given the following shell script dump.sh: #!/usr/bin/env bash cat > /tmp/crash And we see it fails like this: $ RUBY_CRASH_REPORT="|dump.sh" ruby -rfiddle -e "Fiddle::Pointer.new(1, 10)[0]" cat: -: Resource temporarily unavailable
2025-12-08merge revision(s) 6e6f5d3c32a709c891ac6aa7833376907a6c81b5: [Backport #21265]Takashi Kokubun
[PATCH] Add test for [Bug #21265] The crash was fixed by a4dff09be79b52288a47658964d25e5aa84fc960 ("Fix resolving refined module-defined method"). I had a patch for this around for a few months but never merged it. Oops!
2025-12-04Ractor.store_if_absent should not warnKoichi Sasada
```ruby $VERBOSE = true Ractor.store_if_absent :key do end #=> warning: the block passed to 'Ractor.store_if_absent' defined at <internal:ractor>:474 may be ignored ```
2025-12-03Next Ruby version is 4.0, not 3.5Hiroshi SHIBATA
2025-12-01YJIT: Abort expandarray optimization if method_missing is definedRandy Stauner
Fixes: [Bug #21707] [AW: rewrote comments] Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
2025-12-01vm_cc_new: don't assume `cme` is present. (#15322)Jean Boussier
[Bug #21694] `vm_search_super_method` explictly calls `vm_cc_new` with `cme=NULL` when there is no super class.
2025-11-17Avoid spawning thread for trivial getnameinfo callsJohn Hawthorn
When calling getnameinfo we spawn a thread because it may do a slow, blocking reverse-DNS lookup. Spawning a thread is relatively fast (~20µs on my Linux machine) but still an order of magnitude slower than when getnameinfo is simply translating to a numeric IP or port, which, at least in my tests on Linux, doesn't even make a syscall. This commit adds a fast path for when reverse DNS isn't required: either host isn't being fetched or NI_NUMERICHOST is set AND either the service name isn't required or NI_NUMERICSERV is set. The service name should only need to read /etc/services, which should be fast-ish, but is still I/O so I kept the existing behaviour (it could be on a network fs I guess). I tested with: s = TCPSocket.open("www.ruby-lang.org", 80) 500_000.times { Socket.unpack_sockaddr_in(s.getpeername) } Before: 12.935s After: 0.338s
2025-11-14ext/socket: Set raddrinfo thread as detached before thread start (#15194)Luke Gruber
Backport of https://github.com/ruby/ruby/pull/15142 [Bug #21679]
2025-11-14YJIT: Fix stack handling in rb_str_dupJohn Hawthorn
Previously because we did a stack_push before ccall, in some cases we could end up pushing an uninitialized value to the VM stack when spilling regs as part of the ccall. Co-authored-by: Luke Gruber <luke.gru@gmail.com>
2025-11-12Update next stable version to 4.0 from 3.5 (#15146)Hiroshi SHIBATA
2025-11-10Use `IO.popen` instead of `IO.foreach` with pipeNobuyoshi Nakada
2025-11-07Don't modify fstrings in rb_str_tmp_frozen_no_embed_acquire (#15104)John Hawthorn
[Bug #21671]
2025-11-06[Backport #21625] Allow io/wait methods with `IO#ungetc` in text modeNobuyoshi Nakada
2025-11-06[Backport #13671] Fix that "ss" in look-behind causes syntax errorK.Takata
Fixes k-takata/Onigmo#92. This fix was ported from oniguruma: https://github.com/kkos/oniguruma/commit/257082dac8c6019198b56324012f0bd1830ff4ba https://github.com/k-takata/Onigmo/commit/b1a5445fbeba97b3e94a733c2ce11c033453af73