#12313: Fix yet another memory leak caused by caching of coercion data
-------------------------------------------------+--------------------------
Reporter: SimonKing | Owner:
Type: defect | Status: needs_work
Priority: major | Milestone: sage-pending
Component: memleak | Resolution:
Keywords: coercion weak dictionary | Work issues:
Report Upstream: N/A | Reviewers: Simon King,
Jean-Pierre Flori, John Perry, Nils Bruin
Authors: Simon King, Jean-Pierre Flori | Merged in:
Dependencies: #715, #11521, #12215, #13746 | Stopgaps:
-------------------------------------------------+--------------------------
Comment (by SimonKing):
Replying to [comment:269 nbruin]:
> Replying to [comment:268 SimonKing]:
> > * Can we be sure that `self.D` is not None when the `TripleDictEraser`
is called?
> I think so. Setting `self.D=None` must be part of a dealloc on the
`TripleDictEraser` itself.
Yes, right. So, the only problem is when we access an attribute of the
`TripleDict` that is attribute of the `TripleDictEraser`, because the
`TripleDict` could already be destroyed at that point.
> > * Shouldn't the same be done with the `MonoDictEraser`?
>
> I figured this was probably triggered by an interaction of a non-
weakreffable key component holding a reference to a weakreffable key
component, which doesn't happen in `MonoDict`. On the other hand, objects
in `MonoDict` could have a `TripleDict` on an attribute somewhere and I
don't immediately see a proof that such a construct could still lead to
this kind of nasty cycle (especially because I don't quite understand the
nature of the loop here that makes python execute this unnecessary
callback. Apparently Python doesn't purge ''all'' garbage callbacks before
doing ''any'' deletions on cyclic trash)
I'd feel safer to test for the bucket being not None also in the case of
`MonoDict`. I'll submit a patch after lunch.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12313#comment:270>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.