From: Kenta Murata Date: 2011-07-22T22:19:59+09:00 Subject: [ruby-core:38398] [Ruby 1.9 - Bug #5077][Rejected] method_missing throws NoMemoryError after inheriting from BasicObject Issue #5077 has been updated by Kenta Murata. Status changed from Open to Rejected Priority changed from High to Normal BasicObject doesn't include Kernel module. It is a spec. ---------------------------------------- Bug #5077: method_missing throws NoMemoryError after inheriting from BasicObject http://redmine.ruby-lang.org/issues/5077 Author: Farruco Sanjurjo Status: Rejected Priority: Normal Assignee: Category: Target version: 1.9.2 ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32478) [x86_64-linux] If a class inherits from BasicObject and then overwrites method_missing like this: class A < BasicObject def method_missing(*a) puts "#{a}" end end And we try it: A.new.fooooo The interpreter enters what looks like a loop and then crashes with this trace (in irb): NoMemoryError: failed to allocate memory from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' from (irb):3:in `method_missing' If we create the same class with the same method_missing but without inheriting from BasicObject it works right. -- http://redmine.ruby-lang.org