Project

General

Profile

Actions

Bug #7308

closed

Infinite recursion on circular 'using'

Added by Anonymous about 12 years ago. Updated about 12 years ago.

Status:
Closed
Target version:
ruby -v:
2.0.0-preview1
Backport:
[ruby-core:49092]

Description

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.


Files

irb-session.txt (42.2 KB) irb-session.txt Anonymous, 11/08/2012 07:15 PM
prevent-circular-using.patch (1.7 KB) prevent-circular-using.patch Anonymous, 11/09/2012 07:37 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0