Skip to content

Infinite loop when using mutually-referential constants #2314

@jeremyevans

Description

@jeremyevans

The following code appears to cause an infinite loop in JRuby 1.7.17 (OpenBSD) and 1.7.6 (Windows):

def a
  c = Class.new
  c2 = Class.new
  c.const_set(:A, c2)
  c2.const_set(:A, c)
end

Calling that a method causes the CPU to go to 100%, and requires a kill -9 to kill the process.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions