summaryrefslogtreecommitdiff
path: root/version.h
AgeCommit message (Collapse)Author
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-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-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-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-07v3.4.7v3_4_7Takashi Kokubun
2025-10-07merge revision(s) 7ae67e8f6ad6e7fd0677b28a7a10961f79d55495: [Backport #21568]Takashi Kokubun
[PATCH] load.c: Fix dest and src of MEMMOVE When multiple files with the same name are required, the features_index hash stores the indexes in `$LOADED_FEATURES` array into a darray. The dest and src arguments for `MEMMOVE` were wrongly reversed when inserting a new index in the darray. [Bug #21568]
2025-09-29merge revision(s) 354d47ae5bc4edcc94db4a5391ed71a8b9844e57: [Backport #21569]Takashi Kokubun
IBF: Avoid unaligned load on 32 bit platforms [Bug #21569]
2025-09-29merge revision(s) 62430c19c9f1ab49429cebe65f30588472648c95: [Backport #21342]Takashi Kokubun
Properly unlock locked mutexes on thread cleanup. Mutexes were being improperly unlocked on thread cleanup. This bug was introduced in 050a8954395. We must keep a reference from the mutex to the thread, because if the fiber is collected before the mutex is, then we cannot unlink it from the thread in `mutex_free`. If it's not unlinked from the the thread when it's freed, it causes bugs in `rb_thread_unlock_all_locking_mutexes`. We now mark the fiber when a mutex is locked, and the thread is marked as well. However, a fiber can still be freed in the same GC cycle as the mutex, so the reference to the thread is still needed. The reason we need to mark the fiber is that `mutex_owned_p()` has an ABA issue where if the fiber is collected while it's locked, a new fiber could be allocated at the same memory address and we could get false positives. Fixes [Bug #21342] Co-authored-by: John Hawthorn <john@hawthorn.email>
2025-09-29merge revision(s) ef2b26cc3eaed06c5c9d4ef2c6d8669ff357afa4: [Backport #21611]Takashi Kokubun
`struct iseq_catch_table` is packed
2025-09-15v3.4.6v3_4_6Takashi Kokubun
2025-09-12merge revision(s) 7a05dbc47831a655a1ef8a1635f88292acd325da: [Backport #21561]Takashi Kokubun
File.dirname: return consistent encoding for `"."` [Bug #21561] It's preferable if the method is consistent in the encoding in the returned string.
2025-09-12merge revision(s) 928fea3bfa86053c0bc6f7a5bf7559b115a676b5: [Backport #21567]Takashi Kokubun
Fix crash when $LOADED_FEATURES is modified during require [Bug #21567] When we require an object that is not a string, it will attempt to convert it to a string by calling to_str on it. If we modify the $LOADED_FEATURES array while it calls to_str, Ruby can crash because it can end up inserting the string in the wrong index in the array. For example, the following script crashes: require "tempfile" class MyString def initialize(path) @path = path end def to_str $LOADED_FEATURES.clear @path end def to_path = @path end def create_ruby_file = Tempfile.create(["test", ".rb"]).path require MyString.new(create_ruby_file) $LOADED_FEATURES.unshift(create_ruby_file) $LOADED_FEATURES << MyString.new(create_ruby_file) require create_ruby_file Crash log: test.rb:21: [BUG] Segmentation fault at 0x0000000000000004 ruby 3.5.0dev (2025-09-09T09:29:35Z master ce94add7fb) +PRISM [arm64-darwin24] -- Crash Report log information -------------------------------------------- See Crash Report log file in one of the following locations: * ~/Library/Logs/DiagnosticReports * /Library/Logs/DiagnosticReports for more details. Don't forget to include the above Crash Report log file in bug reports. -- Control frame information ----------------------------------------------- c:0003 p:---- s:0011 e:000010 CFUNC :require c:0002 p:0076 s:0006 e:000005 EVAL test.rb:21 [FINISH] c:0001 p:0000 s:0003 E:0001b0 DUMMY [FINISH] -- Ruby level backtrace information ---------------------------------------- test.rb:21:in '<main>' test.rb:21:in 'require' -- Threading information --------------------------------------------------- Total ractor count: 1 Ruby thread count for this ractor: 1 -- Machine register context ------------------------------------------------ x0: 0x0000000000000004 x1: 0x000000000000c800 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0x0000000000000205 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000001 x18: 0x0000000000000000 x19: 0x0000000209dfc0b0 x20: 0x0000000209dfc018 x21: 0x000000016ee8ab58 x22: 0x0fffffff0009d71d x23: 0x0000000209dfc018 x24: 0x0000000209dfc150 x25: 0x000000016ee8acc0 x26: 0x0000000000000000 x27: 0x0000000000000000 x28: 0x0000000000000000 lr: 0x0000000101244140 fp: 0x000000016ee887f0 sp: 0x000000016ee887d0 -- C level backtrace information ------------------------------------------- miniruby(rb_print_backtrace+0x24) [0x101317b08] vm_dump.c:843 miniruby(rb_print_backtrace) (null):0 miniruby(rb_vm_bugreport+0x26c) [0x101317d94] vm_dump.c:1175 miniruby(rb_bug_for_fatal_signal+0xa4) [0x10105ddac] error.c:1130 miniruby(sig_do_nothing+0x0) [0x1012278c0] signal.c:948 miniruby(sigsegv) (null):0 /usr/lib/system/libsystem_platform.dylib(_sigtramp+0x38) [0x19c1216a4] miniruby(rb_str_new_frozen+0x1c) [0x101244140] string.c:1495 miniruby(rb_check_realpath_internal+0x68) [0x101077804] file.c:4679 miniruby(rb_check_realpath+0x2c) [0x101077aa4] file.c:4765 miniruby(get_loaded_features_index+0x37c) [0x1010f9c94] load.c:467 miniruby(rb_feature_p+0xd0) [0x1010f8174] load.c:582 miniruby(search_required+0xac) [0x1010f6ad4] load.c:1193 miniruby(require_internal+0x274) [0x1010f7518] load.c:1424 miniruby(rb_require_string_internal+0x94) [0x1010f6830] load.c:1571 miniruby(rb_require_string+0x58) [0x1010f66e8] load.c:1557 miniruby(rb_f_require+0x1c) [0x1010f6684] load.c:1150 miniruby(ractor_safe_call_cfunc_1+0x38) [0x101306c28] vm_insnhelper.c:3696 miniruby(vm_call_cfunc_with_frame_+0x250) [0x1012f857c] vm_insnhelper.c:3873 miniruby(vm_call_cfunc_with_frame+0x6c) [0x1012f8834] vm_insnhelper.c:3919 miniruby(vm_sendish+0x1a8) [0x1012c990c] vm_insnhelper.c:6087 miniruby(vm_exec_core+0x4050) [0x1012cfb48] insns.def:900 miniruby(vm_exec_loop+0x80) [0x1012e5448] vm.c:2666 miniruby(rb_vm_exec+0x134) [0x1012c9b40] vm.c:2645 miniruby(rb_iseq_eval_main+0x34) [0x1012e5628] vm.c:2919 miniruby(rb_ec_exec_node+0xe4) [0x10106d094] eval.c:282 miniruby(ruby_run_node+0x94) [0x10106cf64] eval.c:320 miniruby(rb_main+0x40) [0x100f7499c] main.c:42 miniruby(main+0x60) [0x100f74928] main.c:62
2025-07-21merge revision(s) 148db9c80f11af1780f0f3685201f28de8f6b47a: [Backport #21259]Takashi Kokubun
Fix flipflop line numbers [ruby-core:121605]
2025-07-15v3.4.5v3_4_5Takashi Kokubun
2025-07-14merge revision(s) b42afa1dbcbb91e89852b3b3bc72484d7f0a5528, ↵Takashi Kokubun
f1f0cc14cc7d3f9be35b203e5583f9224b1e2387, 543e3a1896ae2fe3b5b954f6497d261ab5663a15, ed2806117a0b76e4439ce1a061fae21d9e116d69, 46e4c8673747de96838d2c5dec37446d23d99d88: [Backport #21500] Suppress gcc 15 unterminated-string-initialization warnings Separate `__has_attribute` from `defined(__has_attribute)` Fix Visual C warnings: ``` regenc.h(121): warning C4067: unexpected tokens following preprocessor directive - expected a newline ``` Cast up `int` instruction code to `VALUE` Fix Visual C warnings: ``` iseq.c(3793): warning C4312: 'type cast': conversion from 'int' to 'void *' of greater size iseq.c(3794): warning C4312: 'type cast': conversion from 'int' to 'void *' of greater size ``` Do not let files depend on a phony target Detect `clock_gettime` and `clock_getres` for winpthreads
2025-07-14merge revision(s) d77e02bd85ab7f841df8d473bac214b9a92a3506: [Backport #21497]Takashi Kokubun
[Bug #21497] [ruby/socket]: add full prototype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit otherwise, gcc 15 will complain: > init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3 > 573 | return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len); > | ^~~~~~~~ ~~~~~~~ > In file included from init.c:11: > rubysocket.h:294:5: note: declared here > 294 | int Rconnect(); > | ^~~~~~~~ > sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1 > 33 | SOCKSinit("ruby"); > | ^~~~~~~~~ ~~~~~~ > In file included from sockssocket.c:11: > rubysocket.h:293:6: note: declared here > 293 | void SOCKSinit(); > | ^~~~~~~~~ Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
2025-07-14merge revision(s) c1877d431e76f4a782d51602fa8487e98d302956: [Backport #21437]Takashi Kokubun
[ruby/date] [Bug #21437] Date#hash for large years Addresses https://bugs.ruby-lang.org/issues/21437 Signed-off-by: Dmitry Dygalo <dmitry.dygalo@workato.com> https://github.com/ruby/date/commit/31f07bc576
2025-07-14merge revision(s) 2e7e78cd590d20aa9d41422e96302f3edd73f623: [Backport #21440]Takashi Kokubun
[Bug #21440] Stop caching member list in frozen Data/Struct class
2025-07-14merge revision(s) 1181a682a6c314c92686e3701defa1eb44068c4e, ↵Takashi Kokubun
d84a811f31a65821642b165d712f380c0cc060e0: [Backport #21448] [Bug #21448] Use `getentropy(2)` only on macOS If this is not a system call, then it is using getrandom (which would have been tried already), and cannot be used as a replacement for the random devices. [Bug #21448] Reorder trials in `fill_random_bytes` First try dedicated system calls, such as `getrandom` or `getentropy`, next possible libraries, then fallback to `/dev/urandom`.
2025-07-14merge revision(s) 1d94a9e1a4351e01f851dad250ba97dad859ee70: [Backport #21447]Takashi Kokubun
Fix handling of PM_CONSTANT_PATH_NODE node in keyword arguments with ARGS_SPLAT This was handled correctly in parse.y (NODE_COLON2), but not in prism. This wasn't caught earlier, because I only added tests for the optimized case and not the unoptimized case. Add tests for the unoptimized case. In code terms: ```ruby m(*a, kw: lvar::X) # Does not require allocation for *a m(*a, kw: method()::X) # Requires allocation for *a ``` This commit fixes the second case when prism is used.
2025-07-14merge revision(s) fa85d23ff4a02985ebfe0716b0ff768f5b4fe13d: [Backport #21380]Takashi Kokubun
[Bug #21380] Prohibit modification in String#split block Reported at https://hackerone.com/reports/3163876
2025-07-14merge revision(s) 097d742a1ed53afb91e83aef01365d68b763357b: [Backport #20009]Takashi Kokubun
[Bug #20009] Support marshaling non-ASCII name class/module
2025-07-14merge revision(s) f6cbf499bc98b851034fffb49fcbb59d495f6f7b: [Backport #21354]Takashi Kokubun
Fix Symbol#to_proc (rb_sym_to_proc) to be ractor safe In non-main ractors, don't use `sym_proc_cache`. It is not thread-safe to add to this array without a lock and also it leaks procs from one ractor to another. Instead, we create a new proc each time. If this results in poor performance we can come up with a solution later. Fixes [Bug #21354]
2025-07-14merge revision(s) 5ec9a392cdf7f971221dc073dd466bce877d8acb: [Backport #21439]Takashi Kokubun
[Bug #21439] Fix `PM_SPLAT_NODE` compilation error in for loops (#13597) [Bug #21439] Fix PM_SPLAT_NODE compilation error in for loops This commit fixes a crash that occurred when using splat nodes (*) as the index variable in for loops. The error "Unexpected node type for index in for node: PM_SPLAT_NODE" was thrown because the compiler didn't know how to handle splat nodes in this context. The fix allows code like `for *x in [[1,2], [3,4]]` to compile and execute correctly, where the splat collects each sub-array.
2025-07-14merge revision(s) 8d49c05c134702c321198b70fbbf34dd80cc1ba6: [Backport #21395]Takashi Kokubun
Use the edge version of debug gem
2025-07-14merge revision(s) a084fef9afc7713aa4f4111f7e826c7ca1a607c7: [Backport #21099]Takashi Kokubun
[Bug #21099] Fix GC when Ractor list not initialized When the Ractor list is not initialized and a GC is ran at boot, then it would crash because the newobj_cache of the main Ractor is not cleared. This commit changes it to use ruby_single_main_ractor when it's available and iterate over the Ractor list when we have multiple Ractors.
2025-07-14merge revision(s) 34b407a4a89e69dd04f692e2b29efa2816d4664a: [Backport #21394]Takashi Kokubun
Fix memory leak in Prism's RubyVM::InstructionSequence.new [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
2025-07-14merge revision(s) ff222ac27afe712ef6ec2bb74c81cdde1a1fa176: [Backport #21370]Takashi Kokubun
compile.c: Handle anonymous variables in `outer_variable_cmp` [Bug #21370]
2025-07-14merge revision(s) 9f91f3617bab2ee220d298ddb874ef73b10dac23: [Backport #21383]Takashi Kokubun
Fix memory leak with invalid yield in prism [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
2025-07-14merge revision(s) 056497319658cbefe22351c6ec5c9fa6e4df72bd: [Backport #21357]Takashi Kokubun
[Bug #21357] Fix crash in Hash#merge with block 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.
2025-07-14merge revision(s) 49b306ecb9e2e9e06e0b1590bacc5f4b38169c3c: [Backport #21333]Takashi Kokubun
[Bug #21333] Prohibit hash modification inside Hash#update block
2025-05-13v3.4.4v3_4_4Takashi Kokubun
2025-05-13merge revision(s) 3e47e7a499acd256be549935fcb559d3c82e556c, ↵Takashi Kokubun
b48b841378f80e16378ceb83f3b78e52df9ae023, 2fe8b9cd3d308d754f3d33a948dfb1dd782a10dc: [Backport #21327] Fix redefinition of `clock_gettime` and `clock_getres` winpthreads-git 12.0.0.r720 provides `clock_gettime` and `clock_getres` as inline functions. digest.so needs ruby/digest.h which is installed by build-ext Copy to path with the base name
2025-05-13merge revision(s) bb180b87b43c45e17ff49735a26d7a188d5c8396: [Backport #21331]Takashi Kokubun
[Bug #21331] Prohibit modification during stlike loop
2025-04-14v3.4.3v3_4_3Takashi Kokubun
2025-04-14merge revision(s) 0d6263bd416338a339651fb97fe4d62701704c4b: [Backport #21220]Takashi Kokubun
Fix coverage measurement for negative line numbers Fixes [Bug #21220] Co-Authored-By: Mike Bourgeous <mike@mikebourgeous.com> Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
2025-04-14merge revision(s) 3a7b9ca93b91dcc086b9ac8b9957e59268f9493b: [Backport #21217]Takashi Kokubun
Fix `Integer.sqrt` to never exceed actual value `Integer.sqrt` uses `sqrt(3)` from libm for small values. This method must return a value less than or equal to the actual integer square root, but libm's sqrt does not always guarantee that. This change corrects that by decrementing the result if necessary. Fixes [Bug #21217]
2025-04-14merge revision(s) f27ed98effff9891d28edc7119d45811bcedd510: [Backport #21183]Takashi Kokubun
[ruby/prism] Freeze `Prism::VERSION` Closes https://github.com/ruby/prism/pull/3422 https://github.com/ruby/prism/commit/b488a84253
2025-04-14merge revision(s) 052794bfe1970e90f4f4f9e37fc362dd27903a8d: [Backport #21197]Takashi Kokubun
[ruby/prism] Accept a newline after the defined? keyword [Bug #21197] https://github.com/ruby/prism/commit/22be955ce9