summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
10 daysRemove k0kubun from CODEOWNERSruby_3_4Takashi 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
2025-11-06merge revision(s) d17ce4bd05dc05d48f5f4bc75171fcebda1678ed: [Backport #21652]Alan Wu
[PATCH] [Bug #21652] [DOC] Update unmarshalable object list The `Data` mentioned here was the old `T_DATA` class, not the current extended `Struct`.
2025-11-06[Backport #21638] Mark ractor-local `$VERBOSE` and `$DEBUG`Nobuyoshi Nakada
https://github.com/sampersand/blog/blob/master/the%20-s%20flag.md#the-segfault
2025-11-04merge revision(s) 377aa2a336cc700485c699ac49330f2a58b74906: [Backport #21668]Takashi Kokubun
[PATCH] Improve performance of UnicodeNormalize.canonical_ordering_one Use array_of_integer.sort! instead of buble-sort-like algorithm
2025-11-01mn timer thread: force wakeups for timeoutsAndre Muta
2025-10-29YJIT: Prevent making a branch from a dead block to a live blockAlan Wu
I'm seeing some memory corruption in the wild on blocks in `IseqPayload::dead_blocks`. While I unfortunately can't recreate the issue, (For all I know, it could be some external code corrupting YJIT's memory.) establishing a link between dead blocks and live blocks seems fishy enough that we ought to prevent it. When it did happen, it might've had bad interacts with Code GC and the optimization to immediately free empty blocks.
2025-10-22[ruby/rubygems] Removed credential assertion from stdoutHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/3946be008c
2025-10-22[ruby/rubygems] Bump up vendored uri to 1.0.4Hiroshi SHIBATA
https://github.com/ruby/rubygems/commit/bc77ec0bf2
2025-10-22YJIT: Fix `defined?(yield)` and `block_given?` at top levelAlan Wu
Previously, YJIT returned truthy for the block given query at the top level. That's incorrect because the top level script never receives a block, and `yield` is a syntax error there. Inside methods, the number of hops to get from `iseq` to `iseq->body->local_iseq` is the same as the number of `VM_ENV_PREV_EP(ep)` hops to get to an environment with `VM_ENV_FLAG_LOCAL`. YJIT and the interpreter both rely on this as can be seen in get_lvar_level(). However, this identity does not hold for the top level frame because of `vm_set_eval_stack()`, which sets up `TOPLEVEL_BINDING`. Since only methods can take a block that `yield` goes to, have ISEQs that are the child of a non-method ISEQ return falsy for the block given query. This fixes the issue for the top level script and is an optimization for non-method contexts such as inside `ISEQ_TYPE_CLASS`.
2025-10-20[Bug #21644] compile.c: fix `newrange` INSN peephole optimization for ↵viralpraxis
chilled string ref: https://bugs.ruby-lang.org/issues/21644 ```shell $ ruby -v -e '("a" || "b").."c"' ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux] -e:1: warning: possibly useless use of .. in void context -e:1: [BUG] Stack consistency error (sp: 7, bp: 6) ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux] -- Control frame information ----------------------------------------------- c:0002 p:0013 s:0007 e:000005 EVAL -e:1 [FINISH] c:0001 p:0000 s:0003 E:001920 DUMMY [FINISH] -- Ruby level backtrace information ---------------------------------------- -e:1:in '<main>' -- Threading information --------------------------------------------------- Total ractor count: 1 Ruby thread count for this ractor: 1 -- C level backtrace information ------------------------------------------- ruby/3.4.7/lib/libruby.so.3.4(rb_print_backtrace+0x8) [0x78aa9573c882] /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/vm_dump.c:823 ruby/3.4.7/lib/libruby.so.3.4(rb_vm_bugreport) /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/vm_dump.c:1155 ruby/3.4.7/lib/libruby.so.3.4(rb_bug_without_die_internal+0x6b) [0x78aa9544c62f] /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/error.c:1097 ruby/3.4.7/lib/libruby.so.3.4(rb_bug) /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/error.c:1115 ruby/3.4.7/lib/libruby.so.3.4(vm_stack_consistency_error+0x1f) [0x78aa9544f091] /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/vm_insnhelper.c:6523 ruby/3.4.7/lib/libruby.so.3.4(vm_get_cref) /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/insns.def:1134 ruby/3.4.7/lib/libruby.so.3.4(vm_setclassvariable) /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/vm_insnhelper.c:1630 ruby/3.4.7/lib/libruby.so.3.4(vm_setclassvariable) /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/vm_insnhelper.c:1627 ruby/3.4.7/lib/libruby.so.3.4(vm_exec_core) /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/insns.def:253 ruby/3.4.7/lib/libruby.so.3.4(vm_exec_loop+0xa) [0x78aa95724959] /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/vm.c:2622 ruby/3.4.7/lib/libruby.so.3.4(rb_vm_exec) /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/vm.c:2598 ruby/3.4.7/lib/libruby.so.3.4(rb_ec_exec_node+0xa5) [0x78aa95525695] /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/eval.c:281 ruby/3.4.7/lib/libruby.so.3.4(ruby_run_node+0x83) [0x78aa95529333] /tmp/ruby-build.20251010151551.31019.jR04SY/ruby-3.4.7/eval.c:319 ruby/3.4.7/bin/ruby(rb_main+0x21) [0x59d86f5e0186] ./main.c:43 ruby/3.4.7/bin/ruby(main) ./main.c:68 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_call_main+0x7a) [0x78aa9502a1ca] ../sysdeps/nptl/libc_start_call_main.h:58 /lib/x86_64-linux-gnu/libc.so.6(call_init+0x0) [0x78aa9502a28b] ../csu/libc-start.c:360 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main_impl) ../csu/libc-start.c:347 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main) (null):0 [0x59d86f5e01d5] ``` The optimization in question: https://github.com/ruby/ruby/blob/957c832db137e67289e93dfd9fd9e915b1f2fc87/compile.c\#L3453-L3480 Before entering the `newrange` optimization, the iseq looks like this: ``` == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(1,17)> 0000 putchilledstring "a" ( 1)[Li] 0002 dup 0003 branchif 8 0005 pop 0006 putchilledstring "b" 0008 putchilledstring "c" 0010 newrange 0 0012 leave ``` So the optimization constructs a new range using the wrong operands (`"b"` and `"c"` instead of `"a"` and `"c"`). I tried to fix this by checking whether the two previous instructions are labeled.
2025-10-09Update rexml to 3.4.4 for Ruby 3.4 (CVE-2025-58767) (#14795)Bo Anderson
Update rexml to 3.4.4 [Backport #21632]
2025-10-09Update openssl gem to 3.3.1 for Ruby 3.4 (#14792)Bo Anderson
Update openssl gem to 3.3.1 [Backport #21631]
2025-10-09Backport WASI setjmp handler memory leak fixes to Ruby 3.4 (#14788)刘皓
[Bug #21626]
2025-10-08merge revision(s) 2bb6fe3854e2a4854bb89bfce4eaaea9d848fd1b: [Backport #21629]Takashi Kokubun
[PATCH] [Bug #21629] Initialize `struct RString` which appears to be missed in the previous commit for some reason.
2025-10-08merge revision(s) bbf1130f918ca26e33aba4711ccf99a8083517ea, ↵Takashi Kokubun
43dbb9a93f4de3f1170d7d18641c30e81cc08365, 2bb6fe3854e2a4854bb89bfce4eaaea9d848fd1b, 7c9dd0ecff61153b96473c6c51d5582e809da489: [Backport #21629] [PATCH] Add `RBIMPL_ATTR_NONSTRING_ARRAY()` macro for GCC 15 [PATCH] [Bug #21629] Enable `nonstring` attribute on clang 21 [PATCH] [Bug #21629] Initialize `struct RString` [PATCH] [Bug #21629] Initialize `struct RArray`
2025-10-08post_push.yml: Backport commit-mail to ruby_3_4 (#14781)Takashi Kokubun
2025-10-08Backport fetch_changesets to ruby_3_4 (#14772)Takashi Kokubun
2025-10-07Backport post_push.yml workflow to ruby_3_4 (#14769)Takashi Kokubun