Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Object reference disappearing during global destruction

by Anonymous Monk
on May 15, 2009 at 10:21 UTC ( #764231=note: print w/ replies, xml ) Need Help??


in reply to Object reference disappearing during global destruction

I'm experiencing the same issue. A pair of references are disappering from a hash. The keys that contain the missing references are always the same, independently of the number of keys of the hash. Can anyone throw a bit of light on the subject? Is this a programming error (which I'm missing) or a bug in the garbage collector like someone has suggested? Thanks


Comment on Re: Object reference disappearing during global destruction
Re^2: Object reference disappearing during global destruction
by Anonymous Monk on Mar 18, 2015 at 23:15 UTC
    I had the exact same issue but in a mod_perl enviro. After a few days I found the following in our memoization routines to be the problem:
    return join '', map { $_->{type} eq 'static' ? $_->{body} : $self->execute($_) } @{$self->{BODY}};
    changing it to the following fixes the havoc:
    my @bodies = @{$self->{BODY}}; return join '', map { $_->{type} eq 'static' ? $_->{body} : $self->execute($_) } @bodies;

    dereferencing and iterating over the deref'ed data with maps do untowardly things to item refcounts and the gc reaps its victims when it pleases.

    execute is just a nice wrapper for an eval. it touches nothing inappropriately.

    hope this helps a fellow weary soul.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://764231]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2015-04-21 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who makes your decisions?







    Results (390 votes), past polls