Bug #9505
closedBug that should cause SystemStackError segfaults under Ruby 2.1
Description
Using rspec-core.3.0.0.beta1 and ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]:
require "rspec"
require "rspec/autorun"
describe "Ruby 2.1 segfault" do
  let(:argument) { double }
  subject { subject.new(double) }
  it "will segfault" do
    subject
  end
end
Running this program under Ruby 2.0 results in a SystemStackError. Under Ruby 2.1, Ruby segfaults.
Crash log: https://gist.github.com/jimmycuadra/8892336
Segfault output: https://gist.github.com/jimmycuadra/8892213
        
          
          Updated by hsbt (Hiroshi SHIBATA) over 11 years ago
          
          
        
        
      
      I can reproduce it on Ruby 2.1.1p28. and ruby-trunk(r44894) got SystemStackError.
        
          
          Updated by hsbt (Hiroshi SHIBATA) over 11 years ago
          
          
        
        
      
      - Status changed from Open to Feedback
 
Please try your code with Ruby 2.1.1
        
          
          Updated by danielfone (Daniel Fone) over 11 years ago
          
          
        
        
      
      I can reproduce almost exactly this issue on 2.1.1p97 p76. Full details and steps I used to reproduce are in https://github.com/danielfone/rspec-memoization-segfault
        
          
          Updated by jafergus (James Ferguson) over 11 years ago
          
          
        
        
      
      I've reproduced the same thing with two doubles that reference each other. Also on 2.1.1-p76.
        
          
          Updated by lukeasrodgers (Luke Rodgers) almost 11 years ago
          
          
        
        
      
      For what it's worth, this appears to be fixed in ruby-2.2.0-preview2.
        
          
          Updated by envygeeks (Jordon Bedwell) about 8 years ago
          
          
        
        
      
      lukeasrodgers (Luke Rodgers) wrote:
For what it's worth, this appears to be fixed in ruby-2.2.0-preview2.
This still happens on 2.4.
I just got this today on the latest stable.
        
          
          Updated by wanabe (_ wanabe) about 8 years ago
          
          
        
        
      
      - Related to Bug #13412: Infinite recursion with define_method may cause silent SEGV or cfp consistency error added
 
        
          
          Updated by jeremyevans0 (Jeremy Evans) over 6 years ago
          
          
        
        
      
      - Status changed from Feedback to Closed
 - Backport deleted (
1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN)