#12313: Fix yet another memory leak caused by caching of coercion data
--------------------------------------------------+-------------------------
       Reporter:  SimonKing                       |         Owner:              
                             
           Type:  defect                          |        Status:  
needs_review                             
       Priority:  major                           |     Milestone:  sage-5.3    
                             
      Component:  memleak                         |    Resolution:              
                             
       Keywords:  coercion weak dictionary        |   Work issues:              
                             
Report Upstream:  N/A                             |     Reviewers:  Simon King, 
Jean-Pierre Flori, John Perry
        Authors:  Simon King, Jean-Pierre Flori   |     Merged in:              
                             
   Dependencies:  #11521, #11599, #12969, #12215  |      Stopgaps:              
                             
--------------------------------------------------+-------------------------

Comment (by SimonKing):

 Replying to [comment:182 nbruin]:
 >
 >  - `TripleDictIter` isn't safe wrt to dangling weakrefs. That one's a
 real segfault waiting to happen, because it instantiates object references
 by pointer cast!

 OK.

 >  - `TripleDictEraser` hold a strong reference to the TripleDict. I
 suspect that should be weak, although that adds to deletion costs...

 Why? References to `TripleDictEraser` come from the `TripleDict` it points
 to, and from the weak references that are stored in said `TripleDict`.
 Would this be more than having a reference cycle that only involves
 `KeyedRef`, `TripleDict` and `TripleDictEraser`? None of them has a
 `__del__` method, isn't it?

 >  - You're importing `ConstantFunction` but you don't use it.

 Right.

 > If you have a reliable way of generating the segfaults, it might be
 worth trying with #13387. The iterator there should be safe. There might
 be other issues, though.
 >
 > I have a preference to getting  #715 + #11521 in mergeable state,

 Hence, if you have a working iterator at #13387 then we should use that.
 Note that [attachment:idkey_dict] has a different iterator, thanks to
 Cython now supporting "yield". Do you think that iterator is safe?

 > Most likely explanation is that our MonoDict and TripleDict
 implementations corrupt memory in rare cases and that the other tickets
 trigger that by changing other things so that they get exercised more.
 >
 > Can we get access to the bot or equivalent configuration to recreate the
 circumstances? Or can we get someone involved who can (one is called
 volker-desktop ...).

 I'll meet Volker in St Andrews next week, if I'm not mistaken.

 In the next few days, my resources for working will be a bit limited, but
 I'll try to get my patches from #715 and here in a better state, according
 to your remarks.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12313#comment:183>
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.

Reply via email to