[#61424] [REJECT?] xmalloc/xfree: reduce atomic ops w/ thread-locals — Eric Wong <normalperson@...>

I'm unsure about this. I _hate_ the extra branches this adds;

13 messages 2014/03/12

[ruby-core:61407] [ruby-trunk - Bug #9187] st_table leaks when exception is raised in Hash#rehash

From: nobu@...
Date: 2014-03-11 04:05:35 UTC
List: ruby-core #61407
Issue #9187 has been updated by Nobuyoshi Nakada.

Description updated

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

* Author: Masaki Matsushita
* Status: Closed
* Priority: Normal
* Assignee: Masaki Matsushita
* Category: core
* Target version: 2.1.0
* ruby -v: ruby 2.1.0dev (2013-12-01 trunk 43941) [x86_64-linux]
* Backport: 1.9.3: DONE, 2.0.0: DONE
----------------------------------------
Following code causes leakage of st_table:

~~~ruby
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/

In This Thread

Prev Next