Project

General

Profile

Actions

Bug #6550

closed

crash 1.9.3

Added by mrbrdo (Jan Berdajs) almost 12 years ago. Updated almost 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p234 (2012-06-02 revision 35866) [x86_64-darwin11.4.0]
Backport:
[ruby-core:45441]

Description

I was playing around and I got the 1.9.3 interpreter to crash.
Code: https://gist.github.com/2880210
Don't bother too much with the code I was just playing around. What I am doing there shouldn't work anyway, but it shouldn't crash the interpreter either :) At least I guess.
Run with rspec filename.rb. The crash is related to method_missing and I guess it goes into an infinite circular thingy. Not really sure if something like this is supposed to not error out like this anyway, but I thought I should let you guys know.


Files

crash.log (628 KB) crash.log Console output drbrain (Eric Hodel), 06/07/2012 07:37 AM
ruby_2012-06-06-153627_YPCMC10014.crash (44.2 KB) ruby_2012-06-06-153627_YPCMC10014.crash OS X crash report drbrain (Eric Hodel), 06/07/2012 07:37 AM
ruby193-crash.txt (285 KB) ruby193-crash.txt mrbrdo (Jan Berdajs), 06/07/2012 02:38 PM

Updated by drbrain (Eric Hodel) almost 12 years ago

I cannot reproduce this crash with ruby 1.9.3p125 or ruby trunk r35913.

Can you show the output of your crash?

Updated by drbrain (Eric Hodel) almost 12 years ago

=begin
I have reproduced it and created a minimal test case (without rspec):

class TestClass
def self.tdef name, &tdef_body
define_method name do
self.class.send(:define_method, :method_missing) do |meth, *args|
crash_in_infinite_loop(meth, *args)
end

    instance_eval(&tdef_body)
  end
end

tdef :hello do
  call_method_missing
end

end

TestClass.new.hello

=end

Updated by mrbrdo (Jan Berdajs) almost 12 years ago

Attaching my crash report for my test case (in case it's not the same issue as with your test case). You said you were not able to reproduce it, did you run it with rspec instead of ruby?
Anyway if it's the same problem, your code is more appropriate to test anyway.

Updated by ibc (Iñaki Baz Castillo) almost 12 years ago

drbrain (Eric Hodel) wrote:

=begin
I have reproduced it and created a minimal test case (without rspec):

class TestClass
def self.tdef name, &tdef_body
define_method name do
self.class.send(:define_method, :method_missing) do |meth, *args|
crash_in_infinite_loop(meth, *args)
end

    instance_eval(&tdef_body)
  end
end

tdef :hello do
  call_method_missing
end

end

TestClass.new.hello

=end

Running this code in 1.9.3p0 I don't get a crash, but a simple "stack level too deep (SystemStackError)".
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

Updated by mame (Yusuke Endoh) almost 12 years ago

  • Status changed from Open to Assigned
  • Assignee set to sorah (Sorah Fukumori)

Updated by mame (Yusuke Endoh) almost 12 years ago

  • Assignee changed from sorah (Sorah Fukumori) to mrkn (Kenta Murata)

Updated by mrkn (Kenta Murata) almost 11 years ago

  • Status changed from Assigned to Closed

Close because this cannot be reproduced in ruby_1_9_3 branch.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0