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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0