Project

General

Profile

Bug #9628

Simple and isolated segfault in 2.1.0 and 2.1.1 on Mac OS X 10.9.2 (via rbenv)

Added by Tom Mornini over 2 years ago. Updated over 2 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
ruby -v:
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0] and ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]
[ruby-core:61443]

Description

Example code and output for 2.0.0-p451, 2.1.0 and 2.1.1:

https://gist.github.com/tmornini/9518056

Code:

#!/usr/bin/env ruby

module Subledger
class Error < StandardError
def to_s
"#{message}, HTTP status #{status_code}"
end
end

class BadRequest < Error
def status_code; 400; end
end

fail BadRequest, 'explanation'
end

History

#1 [ruby-core:61444] Updated by Tom Mornini over 2 years ago

Example code and output for 2.0.0-p451, 2.1.0 and 2.1.1:

https://gist.github.com/tmornini/9518056

Code:

#!/usr/bin/env ruby

module Subledger
  class Error < StandardError
    def to_s
      "#{message}, HTTP status #{status_code}"
    end
  end

  class BadRequest                   < Error
    def status_code; 400; end
  end

  fail BadRequest, 'explanation'
end

#2 [ruby-core:61450] Updated by Tomoyuki Chikanaga over 2 years ago

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

Hello,
Thank you for your report.

I can shrink the reproducible script.
And I've confirmed that this issue was reproduced only with 2.1.x. It seems already fixed on trunk.

class MyError < StandardError
  def to_s
    message
  end
end

raise MyError, 'explanation'

Also available in: Atom PDF