Project

General

Profile

Bug #14756

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

Added by yui-knk (Kaneko Yuichiro) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
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.

Associated revisions

Revision 6f0de6ed
Added by nobu (Nobuyoshi Nakada) over 1 year ago

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 63417
Added by nobu (Nobuyoshi Nakada) over 1 year ago

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]

Revision 63417
Added by nobu (Nobuyoshi Nakada) over 1 year ago

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]

Revision 607d93b9
Added by usa (Usaku NAKAMURA) over 1 year ago

merge revision(s) 63417: [Backport #14756]

    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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@64147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 64147
Added by usa (Usaku NAKAMURA) over 1 year ago

merge revision(s) 63417: [Backport #14756]

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]

Revision 6baeed5b
Added by nagachika (Tomoyuki Chikanaga) over 1 year ago

merge revision(s) 63417: [Backport #14756]

    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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@64430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 64430
Added by nagachika (Tomoyuki Chikanaga) over 1 year ago

merge revision(s) 63417: [Backport #14756]

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]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 1 year 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]
#2

Updated by yui-knk (Kaneko Yuichiro) over 1 year 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 1 year 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 1 year 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.

Also available in: Atom PDF