Project

General

Profile

Actions

Bug #13339

closed

Assertion Failed: string.c:2061:rb_str_change_terminator_length:capa >= len

Added by buehmann (Andreas Bühmann) almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
[ruby-core:80257]

Description

This makes ruby 2.4.0 crash on my system (log attached):

('a' * 23).encode('utf-16').encode!('utf-8')

If you change the length of the string (from 23 to 22 or 24), everything's fine.


Files

bug.rb (45 Bytes) bug.rb buehmann (Andreas Bühmann), 03/20/2017 08:21 PM
crash.log (13.6 KB) crash.log buehmann (Andreas Bühmann), 03/20/2017 08:21 PM
Actions #1

Updated by buehmann (Andreas Bühmann) almost 8 years ago

  • Description updated (diff)
Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

  • Status changed from Open to Closed

Applied in changeset r58042.


string.c: use the usable size

  • string.c (rb_str_change_terminator_length): when called after
    the content has been copied, old terminator length no longer
    makes sense. use the whole usable size instead of capacity
    without terminator. [ruby-core:80257] [Bug #13339]
Actions #3

Updated by nagachika (Tomoyuki Chikanaga) almost 8 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: REQUIRED

Updated by naruse (Yui NARUSE) almost 8 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: REQUIRED to 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: DONE

ruby_2_4 r58046 merged revision(s) 58042.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0