Issue #9187 has been reported by Glass_saga (Masaki Matsushita).

----------------------------------------
Bug #9187: st_table leaks when exception is raised in Hash#rehash
https://bugs.ruby-lang.org/issues/9187

Author: Glass_saga (Masaki Matsushita)
Status: Assigned
Priority: Normal
Assignee: Glass_saga (Masaki Matsushita)
Category: core
Target version: current: 2.1.0
ruby -v: ruby 2.1.0dev (2013-12-01 trunk 43941) [x86_64-linux]
Backport: 1.9.3: REQUIRED, 2.0.0: REQUIRED


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


-- 
http://bugs.ruby-lang.org/