Project

General

Profile

Actions

Bug #22548

closed

Segfault after calling String#rindex repeatedly

Bug #22548: Segfault after calling String#rindex repeatedly

Added by rdil (Reece Dunham) 3 days ago. Updated about 2 hours ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:127478]

Description

Not sure what's going on, but this seems to be crashing our production application's Ruby instances in certain cases. I've managed to cut it down to just this minimum reproduction:

k = []; 3000.times { s = 'a' * 55; k << s; s.rindex('😀' * 4) }

I've reproduced on Ruby 3.3.13 and 4.0.5. (On macOS)

Updated by jhawthorn (John Hawthorn) 3 days ago Actions #1 [ruby-core:127480]

Looks like in master this is fixed by https://github.com/ruby/ruby/pull/18658

Updated by rdil (Reece Dunham) 3 days ago Actions #2 [ruby-core:127484]

jhawthorn (John Hawthorn) wrote in #note-1:

Looks like in master this is fixed by https://github.com/ruby/ruby/pull/18658

Just tested and that seems right! Would it be possible to get a backport for that fix to the supported release lines?

Updated by nobu (Nobuyoshi Nakada) 2 days ago Actions #3

  • Status changed from Open to Closed
  • Backport changed from 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN to 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) 1 day ago Actions #5 [ruby-core:127497]

  • Backport changed from 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED to 3.3: REQUIRED, 3.4: DONE, 4.0: REQUIRED

Thank you for filing PRs.
Merged into ruby_3_4 at https://github.com/ruby/ruby/commit/cbdc0c02bb9e527e5c94d75fd7c48024799f3b26.

Actions

Also available in: PDF Atom