From: "shugo (Shugo Maeda)" Date: 2012-11-13T18:07:51+09:00 Subject: [ruby-core:49288] [ruby-trunk - Bug #7308] Infinite recursion on circular 'using' Issue #7308 has been updated by shugo (Shugo Maeda). charliesome (Charlie Somerville) wrote: > I've attached a patch that does a simple DFS to make sure no circular using relationship is created. Thank you. I've changed it to raise an ArgumentError instead of TypeError for the consistency with the cyclic include detection. ---------------------------------------- Bug #7308: Infinite recursion on circular 'using' https://bugs.ruby-lang.org/issues/7308#change-32845 Author: charliesome (Charlie Somerville) Status: Closed Priority: Normal Assignee: shugo (Shugo Maeda) Category: Target version: 2.0.0 ruby -v: 2.0.0-preview1 This code causes infinite recursion: module X; using X; end Note that any circular 'using' will cause infinite recursion, not just a module using itself: module A; end module B; using A; end module A; using B; end This raises a SystemStackError on my OS X Lion machine, but it causes a segmentation fault on Ubuntu 10.04 i686 (running 2.6.32-38). I've attached a dump of an IRB session which finishes with a segfault. -- http://bugs.ruby-lang.org/