Project

General

Profile

Bug #10727

Segfault with newlines + multibyte characters in exception message

Added by eagletmt (Kohei Suzuki) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
[ruby-core:67473]

Description

In Ruby 2.2.0, this simple Ruby script results in segfault.

class E < StandardError
  def initialize
    super("にほんご\n改行")
  end
end

raise E

It's caused by r48637.

Updated by hsbt (Hiroshi SHIBATA) almost 6 years ago

  • Status changed from Open to Assigned
  • Assignee set to usa (Usaku NAKAMURA)

I can reproduce this.

% ruby -v issue10727.rb
issue10727.rb:7:in `<main>': にほんご (E)
issue10727.rb: [BUG] Segmentation fault at 0x00000000000008
ruby 2.3.0dev (2015-01-09 trunk 49195) [x86_64-darwin13]

Updated by usa (Usaku NAKAMURA) almost 6 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset r49201.


  • eval_error.c (error_print): pos and len parameters of rb_str_substr() are counted by characters, not bytes. use rb_str_subseq() instead. [Bug #10727] [ruby-core:67473]

Updated by usa (Usaku NAKAMURA) almost 6 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED

Updated by naruse (Yui NARUSE) almost 6 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE

ruby_2_2 r49298 merged revision(s) 49201,49203.

Also available in: Atom PDF