Project

General

Profile

Actions

Bug #9187

closed

st_table leaks when exception is raised in Hash#rehash

Added by Glass_saga (Masaki Matsushita) almost 11 years ago. Updated over 10 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.1.0dev (2013-12-01 trunk 43941) [x86_64-linux]
[ruby-core:58728]

Description

Following code causes leakage of st_table:

class Foo
  def initialize
    @raise = false
  end

  def hash
    raise if @raise
    @raise = true
    return 0
  end
end

h = {Foo.new => true}
10_0000.times do
  h.rehash rescue nil
end
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0