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.