Project

General

Profile

Actions

Bug #10368

closed

GC mark miss on bindings

Added by ktsj (Kazuki Tsujimoto) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-10-11 trunk 47881) [x86_64-linux]
[ruby-dev:48616]

Description

以下のコードでSEGVすることがあります。
mに渡したブロックがGCされてしまうのが原因です。

def m
  binding
end

GC.stress = true
b = nil
tap do 
  b = m {}
end
GC.start
0.times.to_a
b.eval('yield')

ブロックに対応するProcオブジェクトをrb_binding_tに持たせるようにするパッチを添付します。


Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0