Project

General

Profile

Actions

Bug #12876

closed

Calling new hangs Ruby when class prepends an empty module and makes initialize method public

Added by floehopper (James Mead) about 8 years ago. Updated about 8 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.0.0p648 and ruby 2.1.3p242 onwards
[ruby-core:77784]

Description

module Foo
end

class Bar
  prepend Foo

  public :initialize
end

p Bar.new # => hangs

Runs OK

  • ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin14.0]
  • ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin14.0]
  • ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin14.0]
  • rubinius 3.33 (2.2.2 db6f477e 2016-05-23 3.8.1) [x86_64-darwin14.5.0]

Hangs on last line

  • ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-darwin14.5.0]
  • ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin14.0]
  • ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]
  • ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-darwin14.0]
  • ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin14]
  • ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin14]
  • ruby 2.4.0preview2 (2016-09-09 trunk 56129) [x86_64-darwin14]

This might be related to Bug #12832, although in this case it is possible to interrupt with ctrl-C and the problem exists in Ruby v2.0.0 as well as v2.1.3 onwards.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #12920: Strange NoMethodError in Time.nowClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0