[#122369] [Ruby Bug#21392] Data classes do not allow overriding #inspect — "austin (Austin Ziegler) via ruby-core" <ruby-core@...>

Issue #21392 has been reported by austin (Austin Ziegler).

8 messages 2025/06/01

[#122411] [Ruby Bug#21396] Set#initialize should call Set#add on items passed in — "tenderlovemaking (Aaron Patterson) via ruby-core" <ruby-core@...>

Issue #21396 has been reported by tenderlovemaking (Aaron Patterson).

12 messages 2025/06/04

[#122506] [Ruby Feature#21435] Kernel#optional as a conditional #then — "Alexander.Senko (Alexander Senko) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNDM1IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IEFsZXhhbmRlci5TZW5rbyAoQWxleGFu

11 messages 2025/06/10

[#122557] [Ruby Bug#21445] [BUG] push_mark_stack() called for broken object raised since cd9f447be247478d2eb3da985295735cce20cb23 — "yahonda (Yasuo Honda) via ruby-core" <ruby-core@...>

Issue #21445 has been reported by yahonda (Yasuo Honda).

10 messages 2025/06/19

[#122615] [Ruby Misc#21458] Test 'make install'? — "MSP-Greg (Greg L) via ruby-core" <ruby-core@...>

Issue #21458 has been reported by MSP-Greg (Greg L).

11 messages 2025/06/28

[ruby-core:122538] [Ruby Bug#21380] Use-After-Free in String#split with In-Block String Modification

From: "nagachika (Tomoyuki Chikanaga) via ruby-core" <ruby-core@...>
Date: 2025-06-15 04:18:23 UTC
List: ruby-core #122538
Issue #21380 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED to 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED

ruby_3_3 commit:8908cb07829628115f7455508c2d5885ac99c939 merged revision(s) commit:fa85d23ff4a02985ebfe0716b0ff768f5b4fe13d.

----------------------------------------
Bug #21380: Use-After-Free in String#split with In-Block String Modification
https://bugs.ruby-lang.org/issues/21380#change-113764

* Author: bytesmith (Bachir Bendrissou)
* Status: Closed
* ruby -v: 3.5.0
* Backport: 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED
----------------------------------------
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/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/


In This Thread

Prev Next