Bug #6550

crash 1.9.3

Added by Jan Berdajs almost 2 years ago. Updated 11 months ago.

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

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.

crash.log - Console output (628 KB) Eric Hodel, 06/07/2012 07:37 AM

ruby_2012-06-06-153627_YPCMC10014.crash - OS X crash report (44.2 KB) Eric Hodel, 06/07/2012 07:37 AM

ruby193-crash.txt Magnifier (285 KB) Jan Berdajs, 06/07/2012 02:38 PM

History

#1 Updated by Eric Hodel almost 2 years ago

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

Can you show the output of your crash?

#2 Updated by Eric Hodel almost 2 years ago

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

class TestClass
def self.tdef name, &tdefbody
define
method name do
self.class.send(:definemethod, :methodmissing) do |meth, *args|
crashininfinite_loop(meth, *args)
end

    instance_eval(&tdef_body)
  end
end

tdef :hello do
  call_method_missing
end

end

TestClass.new.hello

=end

#3 Updated by Jan Berdajs almost 2 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.

#4 Updated by Iñaki Baz Castillo almost 2 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, &tdefbody
define
method name do
self.class.send(:definemethod, :methodmissing) do |meth, *args|
crashininfinite_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]

#5 Updated by Yusuke Endoh almost 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Shota Fukumori

#6 Updated by Yusuke Endoh almost 2 years ago

  • Assignee changed from Shota Fukumori to Kenta Murata

#7 Updated by Kenta Murata 11 months ago

  • Status changed from Assigned to Closed

Close because this cannot be reproduced in ruby19_3 branch.

Also available in: Atom PDF