[#9722] Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters — <noreply@...>

Bugs item #7278, was opened at 2006-12-14 13:59

8 messages 2006/12/14

[#9749] System V IPC in standard library? — Steven Jenkins <steven.jenkins@...>

Back in August, I needed a semaphore to serialize access to an external

14 messages 2006/12/19

[#9753] CVS freeze — SASADA Koichi <ko1@...>

Hi,

20 messages 2006/12/20
[#9755] Re: [ruby-dev:30039] CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

[#9757] Re: [ruby-dev:30040] Re: CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

Re: [ ruby-Bugs-7153 ] WeakRefs not "weak" on FreeBSD/Mac OS X

From: Eric Hodel <drbrain@...7.net>
Date: 2006-12-07 20:25:32 UTC
List: ruby-core #9677
On Dec 7, 2006, at 10:52 , <noreply@rubyforge.org>  
<noreply@rubyforge.org> wrote:

> Bugs item #7153, was opened at 2006-12-07 13:51
> You can respond by visiting:
> http://rubyforge.org/tracker/? 
> func=detail&atid=1698&aid=7153&group_id=426
>
> Category: Core
> Group: 1.8.x
> Status: Open
> Resolution: None
> Priority: 3
> Submitted By: Riley Lynch (rlynch)
> Assigned to: Nobody (None)
> Summary: WeakRefs not "weak" on FreeBSD/Mac OS X
>
> Initial Comment:
> The documentation code for WeakRef does not behave as expected  
> under FreeBSD and Mac OS X:
>
>   require 'weakref'
>
>   foo = Object.new
>   p foo.to_s                  # original's class
>   foo = WeakRef.new(foo)
>   p foo.to_s                  # should be same class
>   ObjectSpace.garbage_collect
>   p foo.to_s                  # should raise exception (recycled)

Ruby's garbage collector is conservative and walks the stack looking  
for possible references.  In this case the weakly referenced object  
is probably still on the stack:

require 'weakref'

def make_ref
   o = Object.new
   WeakRef.new o
end

ref = make_ref
p ref.to_s
GC.start
p ref.to_s

ruby 1.8.5 (2006-08-25) [powerpc-darwin8.7.0]
"#<Object:0x1c2ca8>"
x.rb:11: Illegal Reference - probably recycled (WeakRef::RefError)

-- 
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!


In This Thread

Prev Next