ml.ruby-lang.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

ruby-core

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
ruby-core@ml.ruby-lang.org

July 2025

  • 2 participants
  • 109 discussions
[ruby-core:122777] [Ruby Feature#17473] Make Pathname to embedded class of Ruby
by deivid 15 Jul '25

15 Jul '25
Issue #17473 has been updated by deivid (David Rodríguez). Would it make sense to make `find`, `fileutils`, and `tmpdir` also builtin, given that `pathname` depends on them? ---------------------------------------- Feature #17473: Make Pathname to embedded class of Ruby https://bugs.ruby-lang.org/issues/17473#change-114055 * Author: hsbt (Hiroshi SHIBATA) * Status: Closed * Assignee: akr (Akira Tanaka) ---------------------------------------- pathname is one of most useful utility class of Ruby. I'm happy to use Pathname without require it. Any thought? -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:122776] [Ruby Feature#17473] Make Pathname to embedded class of Ruby
by hsbt (Hiroshi SHIBATA) 15 Jul '25

15 Jul '25
Issue #17473 has been updated by hsbt (Hiroshi SHIBATA). Status changed from Assigned to Closed I made `Pathname` to embedded core class now. * https://github.com/ruby/ruby/pull/13873 * https://github.com/ruby/ruby/pull/13885 * https://github.com/ruby/ruby/pull/13887 `Pathname#find`, `Pathname#mkpath`, `Pathname#rmtree` and `Pathname.mktmpdir` is remained on `lib/pathname.rb`. So, the users need to require `pathname.rb` for that methods. We should migrate them to `pathname_builtin.rb` or `pathname.c` without extra dependencies. ---------------------------------------- Feature #17473: Make Pathname to embedded class of Ruby https://bugs.ruby-lang.org/issues/17473#change-114054 * Author: hsbt (Hiroshi SHIBATA) * Status: Closed * Assignee: akr (Akira Tanaka) ---------------------------------------- pathname is one of most useful utility class of Ruby. I'm happy to use Pathname without require it. Any thought? -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:122665] [Ruby Bug#21503] \p{Word} does not match on \p{Join_Control} while docs say it does
by procmarco (Marco Concetto Rudilosso) 14 Jul '25

14 Jul '25
Issue #21503 has been reported by procmarco (Marco Concetto Rudilosso). ---------------------------------------- Bug #21503: \p{Word} does not match on \p{Join_Control} while docs say it does https://bugs.ruby-lang.org/issues/21503 * Author: procmarco (Marco Concetto Rudilosso) * Status: Open * ruby -v: 3.4.4 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- in the [docs](https://ruby-doc.org/3.4.1/Regexp.html#:~:text=/%5Cp%7B-,Word,-%7D/%3… it is mentioned that `\p{Word}` matches the equivalent of: `[\p{M}\p{Nd}\p{Pc}\p{Alpha}\p{Join_Control}]` as it's also defined in the [unicode spec](https://unicode.org/reports/tr18/#word) the issue is that it does not seem to be the case ``` irb(main):018> REGEX = /\p{Word}/u => /\p{Word}/ irb(main):019> "\u200D".gsub(REGEX, "-") => "‍" irb(main):020> REGEX2 = /\p{Join_Control}/u => /\p{Join_Control}/ irb(main):021> "\u200D".gsub(REGEX2, "-") => "-" ``` There's 2 solutions here, either we change the docs or the code. -- https://bugs.ruby-lang.org/
5 5
0 0
[ruby-core:122548] [Ruby Bug#21441] SEGV during thread cleanup if profiler calls thread_profiles_frames at wrong time
by luke-gru (Luke Gruber) 14 Jul '25

14 Jul '25
Issue #21441 has been reported by luke-gru (Luke Gruber). ---------------------------------------- Bug #21441: SEGV during thread cleanup if profiler calls thread_profiles_frames at wrong time https://bugs.ruby-lang.org/issues/21441 * Author: luke-gru (Luke Gruber) * Status: Open * ruby -v: 3.5.0 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- During thread cleanup, if a ruby sampling profiler calls `thread_profile_frames` at just the wrong time, the ec's stack is cleared but the CFP still exists on the EC, so `thread_profile_frames` assumes it can walk the stack and crashes. In `rb_ec_clear_vm_stack`, it should set `cfp` to `NULL` before clearing the stack. If during `rc_ec_clear_vm_stack` the process gets a signal and this thread handles it and calls `thread_profile_frames`, the early return check of `if (!cfp)` fails, it continues and crashes in this function. -- https://bugs.ruby-lang.org/
3 3
0 0
[ruby-core:122516] [Ruby Bug#21437] Date#hash may return different values for equal dates with large years
by Stranger6667 (Dmitry Dygalo) 14 Jul '25

14 Jul '25
Issue #21437 has been reported by Stranger6667 (Dmitry Dygalo). ---------------------------------------- Bug #21437: Date#hash may return different values for equal dates with large years https://bugs.ruby-lang.org/issues/21437 * Author: Stranger6667 (Dmitry Dygalo) * Status: Open * ruby -v: 3.2.8 - 3.4.4 (and older versions too) * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Parsing the same date string allocates new large integer objects with different pointer addresses, which then affects the hash value due to `d_lite_hash` behavior. ```ruby require 'date' # Small year - consistent hashes Date.strptime('2024-5-9', '%Y-%m-%d').hash #=> 3287407234087466140 Date.strptime('2024-5-9', '%Y-%m-%d').hash #=> 3287407234087466140 # BUG - Large year - different hashes for identical date strings Date.strptime('3171505571716611468830131104691-5-9', '%Y-%m-%d').hash #=> 3525034678868094350 Date.strptime('3171505571716611468830131104691-5-9', '%Y-%m-%d').hash #=> 2502076152602341316 # Different hash for same date! ``` In [ext/date/date_core.c](https://github.com/ruby/ruby/blob/v3_4_4/ext/date/dat…: ```c static VALUE d_lite_hash(VALUE self) { st_index_t v, h[4]; get_d1(self); h[0] = m_nth(dat); // Could be different for equal large integers // ... v = rb_memhash(h, sizeof(h)); return ST2FIX(v); } ``` Each call to `Date.strptime` with a large year allocates a new large integer for `m_nth(dat)`. The hash function uses this pointer address directly in `rb_memhash`, so equal dates parsed separately get different hashes. This breaks the hash contract that equal objects must have equal hashes. -- https://bugs.ruby-lang.org/
3 2
0 0
[ruby-core:122523] [Ruby Bug#21440] Cannot create instances of frozen Data subclasses
by jeremyevans0 (Jeremy Evans) 14 Jul '25

14 Jul '25
Issue #21440 has been reported by jeremyevans0 (Jeremy Evans). ---------------------------------------- Bug #21440: Cannot create instances of frozen Data subclasses https://bugs.ruby-lang.org/issues/21440 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Backport: 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED ---------------------------------------- This fails since Data was added in Ruby 3.2: ```ruby Class.new(Data.define(:a)).freeze.new # can't modify frozen #<Class:#<Class:0x000079cf41253160>>: #<Class:0x000079cf41253160> (FrozenError) ``` Note that the error occurs even before the ArgumentError due to the missing argument to `new`. This doesn't happen on classes created with `Data.define` (only subclasses of those classes): ```ruby Data.define(:a).freeze.new # missing keyword: :a (ArgumentError) ``` -- https://bugs.ruby-lang.org/
4 3
0 0
[ruby-core:122561] [Ruby Bug#21447] Fix handling of PM_CONSTANT_PATH_NODE node in keyword arguments with ARGS_SPLAT
by jeremyevans0 (Jeremy Evans) 14 Jul '25

14 Jul '25
Issue #21447 has been reported by jeremyevans0 (Jeremy Evans). ---------------------------------------- Bug #21447: Fix handling of PM_CONSTANT_PATH_NODE node in keyword arguments with ARGS_SPLAT https://bugs.ruby-lang.org/issues/21447 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Assignee: jeremyevans0 (Jeremy Evans) * Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED ---------------------------------------- I added an optimization to reduce implicit allocations when using parse.y in commit:3de20efc308cccc38bf9dacfffca6c626d039a06. An implementation was added for prism in commit:14bb376b79ca9140bfd36dbbad06be045f31f92e. Unfortunately, when I added tests for the optimization, I only tested the optimizable case for `NODE_COLON2` (`Foo::Bar`). I neglected to add a test for the unoptimizable case (`foo()::Bar`). The prism implementation of the optimization incorrectly optimized the unoptimizable case (for `PM_CONSTANT_PATH_NODE`), but that's because the tests did not fail when it was incorrectly optimized. This can cause an evaluation order issue in the following code if `foo` modifies `array`: ```ruby method(*array, kw: foo(array)::Bar) ``` I've submitted a PR that adds tests for the unoptimizable case, and fixes the prism implementation of the optimization: https://github.com/ruby/ruby/pull/13664 -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:122554] [Ruby Bug#21443] Backport: Fix heap-use-after-free in free_fast_fallback_getaddrinfo_entry
by rochlefebvre (Roch Lefebvre) 14 Jul '25

14 Jul '25
Issue #21443 has been reported by rochlefebvre (Roch Lefebvre). ---------------------------------------- Bug #21443: Backport: Fix heap-use-after-free in free_fast_fallback_getaddrinfo_entry https://bugs.ruby-lang.org/issues/21443 * Author: rochlefebvre (Roch Lefebvre) * Status: Open * ruby -v: ruby 3.4.4 (2025-05-14 revision a38531fd3f) +PRISM [arm64-darwin23] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Please backport the following AddressSanitizer error into Ruby 3.4 https://github.com/ruby/ruby/pull/13231 I did not find a ticket related to the original fix. Thank you! -- https://bugs.ruby-lang.org/
3 2
0 0
[ruby-core:122327] [Ruby Bug#21380] Use-After-Free in String#split with In-Block String Modification
by bytesmith (Orin Nova) 14 Jul '25

14 Jul '25
Issue #21380 has been reported by bytesmith (Orin Nova). ---------------------------------------- Bug #21380: Use-After-Free in String#split with In-Block String Modification https://bugs.ruby-lang.org/issues/21380 * Author: bytesmith (Orin Nova) * Status: Open * ruby -v: 3.5.0 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- A use-after-free bug can be triggered in Ruby's String#split when the target string is modified within the block passed to split. Ruby version: ``` ./ruby -v ruby 3.5.0dev (2025-05-28T04:34:40Z master d064fd067b) +PRISM [x86_64-linux] ``` Program input: ``` str = "one two" def mutate(s) s.prepend("junk" * 1000) end counter = 0 loop do str.split { mutate(str) } counter += 1 break if counter > 10 end ``` ASAN output: ``` ================================================================= ==30097==ERROR: AddressSanitizer: heap-use-after-free on address 0x526000002fe4 at pc 0x562c9f1bad20 bp 0x7ffc937b5440 sp 0x7ffc937b5430 READ of size 1 at 0x526000002fe4 thread T0 #0 0x562c9f1bad1f in rb_str_split_m ../string.c:9765 #1 0x562c9f2eb9c5 in vm_call_cfunc_with_frame_ ../vm_insnhelper.c:3774 #2 0x562c9f3056f6 in vm_sendish ../vm_insnhelper.c:5971 #3 0x562c9f3543b7 in vm_exec_core ../insns.def:851 #4 0x562c9f32315e in rb_vm_exec ../vm.c:2625 #5 0x562c9f367157 in rb_iseq_eval_main ../vm.c:2905 #6 0x562c9ee6078a in rb_ec_exec_node ../eval.c:281 #7 0x562c9ee67e4d in ruby_run_node ../eval.c:319 #8 0x562c9ee575c1 in rb_main ../main.c:42 #9 0x562c9ee575c1 in main ../main.c:62 #10 0x7f7ecc8811c9 (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 42c84c92e6f98126b3e2230ebfdead22c235b667) #11 0x7f7ecc88128a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 42c84c92e6f98126b3e2230ebfdead22c235b667) ``` -- https://bugs.ruby-lang.org/
3 2
0 0
[ruby-core:122215] [Ruby Bug#21356] Error when accessing local variable named "default" with Binding#local_variable_get
by richardboehme 14 Jul '25

14 Jul '25
Issue #21356 has been reported by richardboehme (Richard Böhme). ---------------------------------------- Bug #21356: Error when accessing local variable named "default" with Binding#local_variable_get https://bugs.ruby-lang.org/issues/21356 * Author: richardboehme (Richard Böhme) * Status: Open * ruby -v: ruby 3.5.0dev (2025-05-21T06:12:18Z master f6cbf499bc) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- On Ruby master when using `Binding#local_variable_get` with the name `:default` it raises the following error: ``` 'Binding#local_variable_get': numbered parameter 'default' is not a local variable (NameError) ``` I saw that this error was introduced in #21049 but it seems like the check for whether the passed variable name is a numbered parameter does not work for the `:default` symbol. I think this might be an off-by-one error in the `rb_numparam_id_p` function in proc.c, where instead of adding 9 (the maximum number of numbered parameters) to tNUMPARAM_1 we currently add 10 which then includes the id of default as well? Compiling with this change (see attached diff) fixed the issue but I'm not sure if it might break other things. ---Files-------------------------------- patch.diff (384 Bytes) -- https://bugs.ruby-lang.org/
4 4
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.