Bug #6550
closedcrash 1.9.3
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
Updated by drbrain (Eric Hodel) over 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) over 12 years ago
- File crash.log crash.log added
- File ruby_2012-06-06-153627_YPCMC10014.crash ruby_2012-06-06-153627_YPCMC10014.crash added
=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) over 12 years ago
- File ruby193-crash.txt ruby193-crash.txt added
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) over 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)
endinstance_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) over 12 years ago
- Status changed from Open to Assigned
- Assignee set to sorah (Sorah Fukumori)
Updated by mame (Yusuke Endoh) over 12 years ago
- Assignee changed from sorah (Sorah Fukumori) to mrkn (Kenta Murata)
Updated by mrkn (Kenta Murata) over 11 years ago
- Status changed from Assigned to Closed
Close because this cannot be reproduced in ruby_1_9_3 branch.