#11339: Illegal use of __deallocate__ in cython (pyx) code
-----------------------------------------------+----------------------------
   Reporter:  gagern                           |          Owner:  drkirkby      
                 
       Type:  defect                           |         Status:  needs_work    
                 
   Priority:  major                            |      Milestone:  sage-4.7.1    
                 
  Component:  porting                          |       Keywords:  sd31          
                 
Work_issues:                                   |       Upstream:  N/A           
                 
   Reviewer:  François Bissey, Steven Trogdon  |         Author:  Volker Braun, 
Martin von Gagern
     Merged:                                   |   Dependencies:                
                 
-----------------------------------------------+----------------------------

Comment(by vbraun):

 The Python docs say "The `tp_clear` member function is used to break
 reference cycles in cyclic garbage detected by the garbage collector.", so
 there must have been a cycle involving the `GroebnerStrategy` instance.

 I looked a bit at the source and we definitely have cycles
 ideal<->`GroebnerStrategy`. Both refer to the parent ring, and this
 explains why `tp_clear` was called on `GroebnerStrategy`. I haven't found
 a place where the parent refers back to the cycle. In this situation
 Martin's patch should work as we can get rid of the cycle while the parent
 has positive refcount. It could be that Python 2.7 got smarter and deletes
 the parent together with the cycle while Python 2.6 first deleted the
 cycle and only then noticed that nothing else refers to the parent any
 more. This would explain why Martin's patch works but my attempt of
 blindly accessing the ring C structure fails on Python 2.7.

 There is a lot of stuff that could conceivably create a larger cycle
 involving the parent even though I haven't found one. For one, the parent
 keeps a reference to the "one" element. Even then, I think it is too
 dangerous to make the hidden assumption that there are no complete cycles
 involving the parents. Somebody is bound to trip over this sooner or
 later.

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