From: "shyouhei (Shyouhei Urabe)" Date: 2012-08-14T10:19:50+09:00 Subject: [ruby-core:47171] [ruby-trunk - Bug #6863] Class#initialize infinite loops when passed self Issue #6863 has been updated by shyouhei (Shyouhei Urabe). charliesome (Charlie Somerville) wrote: > x = Class.allocate Why on earth is this allowed? I have no idea how useful an non-initiaized class is. So instead of checking circular inheritance, I would propose to simply disable Class.allocate. ---------------------------------------- Bug #6863: Class#initialize infinite loops when passed self https://bugs.ruby-lang.org/issues/6863#change-28850 Author: charliesome (Charlie Somerville) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: 2.0.0dev =begin The following code sends Ruby into an infinite loop: x = Class.allocate x.send :initialize, x The problem appears to be in rb_class_initialize (object.c:1564) when Ruby attempts to call (({#inherited})) on the newly created class. The method lookup infinite loops as it tries to descend the ancestor chain. This should probably throw a (({TypeError})) instead. =end -- http://bugs.ruby-lang.org/