[#68137] improve semantics of manpages — "Anthony J. Bentley" <anthony@...>
Hi,
1 message
2015/02/17
[#68144] Re: Future of test suites for Ruby — Anthony Crumley <anthony.crumley@...>
FYI...
4 messages
2015/02/17
[#68343] [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault? — ruby@...
Issue #10916 has been reported by why do i need this acct just to create a bug report.
5 messages
2015/02/27
[#68373] Re: [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault?
— "Martin J. Dürst" <duerst@...>
2015/03/02
> * Author: why do i need this acct just to create a bug report
[#68358] [Ruby trunk - Bug #10902] require("enumerator") scans LOAD_PATH 2x on every invocation — ruby@...1.net
Issue #10902 has been updated by Aman Gupta.
3 messages
2015/02/28
[ruby-core:68020] [ruby-trunk - Bug #10620] [Closed] #define_singleton_method keeps object from being garbage collected
From:
shugo@...
Date:
2015-02-05 08:56:47 UTC
List:
ruby-core #68020
Issue #10620 has been updated by Shugo Maeda.
Status changed from Open to Closed
----------------------------------------
Bug #10620: #define_singleton_method keeps object from being garbage collected
https://bugs.ruby-lang.org/issues/10620#change-51407
* Author: Sean Dilda
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: 2.1.5
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
After using #define_singleton_method on an object, the object is never garbage collected
Sample code:
#!/usr/bin/env ruby
obj = Object.new
obj_id = obj.object_id
obj = nil
GC.start
GC.start
GC.start
GC.start
begin
ObjectSpace._id2ref obj_id
puts "GC failed, object still exists"
rescue RangeError
puts "GC worked"
end
obj = Object.new
obj.define_singleton_method(:f) { "F" }
obj_id = obj.object_id
obj = nil
GC.start
GC.start
GC.start
GC.start
begin
ObjectSpace._id2ref obj_id
puts "GC failed, object still exists"
rescue RangeError
puts "GC worked"
end
This outputted:
GC worked
GC failed, object still exists
The object without the singleton method was cleaned up properly, the object with defined_singleton_method used never got cleaned up.
--
https://bugs.ruby-lang.org/