Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Object reference disappearing during global destruction

by Anonymous Monk
on May 15, 2009 at 10:21 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://764231]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-25 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found