#13896: Fix cython's gc_track and gc_untrack
------------------------------------------------------------------+---------
       Reporter:  nbruin                                          |         
Owner:  rlm     
           Type:  defect                                          |        
Status:  new     
       Priority:  blocker                                         |     
Milestone:  sage-5.6
      Component:  memleak                                         |    
Resolution:          
       Keywords:                                                  |   Work 
issues:          
Report Upstream:  Reported upstream. Developers acknowledge bug.  |     
Reviewers:          
        Authors:                                                  |     Merged 
in:          
   Dependencies:                                                  |      
Stopgaps:          
------------------------------------------------------------------+---------

Comment (by robertwb):

 Replying to [comment:16 jpflori]:
 > Replying to [comment:11 robertwb]:
 > > The final call to the (generic) tp_free calls PyObject_GC_Untrack iff
 the GC flags are set in the type flags.  If the base class is not GC
 tracked then its dealloc method won't touch these bits.
 > Sorry to insist a little bit, but while looking at the trashcan stuff, I
 thought again about it and in fact what I was worried about was rather the
 converse.
 >
 > If the base type does not have the GC_FLAG, and youve retracked it in
 the subclass, then final tp_free will indeed not touch anything related to
 gc, but won't that leave an invalid object in the gc tracked object list?
 > In particular won't a call to gc_list_remove(o) be missing?

 The base tp_free looks at the actual type's flags (which will have GC_FLAG
 set) to determine what gc (un)tracking to do. Any intermediate
 superclasses will either leave this alone or do the untrack/track dance.

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