Project

General

Profile

Actions

Bug #14756

closed

`Exception` may cause SEGV when `#backtrace` returns a string

Added by yui-knk (Kaneko Yuichiro) almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-05-13 trunk 63413) [x86_64-linux]
[ruby-core:87013]

Description

This code causes SEGV, because print_backtrace expects second argument to be an array but a string is given.

class Exception
  def backtrace
    "backtrace"
  end
end

"".a

Also in ruby 2.3.7, 2.4.4, 2.5.1.

Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 6 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r63417.


error.c: check redefined backtrace result

  • error.c (rb_get_backtrace): check the result of backtrace even
    if the method is redefined. [ruby-core:87013] [Bug #14756]
Actions #2

Updated by yui-knk (Kaneko Yuichiro) almost 6 years ago

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

Updated by usa (Usaku NAKAMURA) over 5 years ago

  • Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: REQUIRED, 2.4: DONE, 2.5: REQUIRED

ruby_2_4 r64147 merged revision(s) 63417.

Updated by nagachika (Tomoyuki Chikanaga) over 5 years ago

  • Backport changed from 2.3: REQUIRED, 2.4: DONE, 2.5: REQUIRED to 2.3: REQUIRED, 2.4: DONE, 2.5: DONE

ruby_2_5 r64430 merged revision(s) 63417.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0