Actions
Bug #10727
closedSegfault with newlines + multibyte characters in exception message
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 10 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 10 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 10 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 eagletmt (Kohei Suzuki) almost 10 years ago
Thanks!
Updated by naruse (Yui NARUSE) almost 10 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.
Actions
Like0
Like0Like0Like0Like0Like0