#13447: Make libsingular multivariate polynomial rings collectable
-------------------------------------------------------+--------------------
       Reporter:  nbruin                               |         Owner:  rlm    
                       
           Type:  defect                               |        Status:  
needs_info                    
       Priority:  major                                |     Milestone:  
sage-5.4                      
      Component:  memleak                              |    Resolution:         
                       
       Keywords:                                       |   Work issues:  Input 
from libsingular experts
Report Upstream:  Reported upstream. No feedback yet.  |     Reviewers:         
                       
        Authors:                                       |     Merged in:         
                       
   Dependencies:                                       |      Stopgaps:         
                       
-------------------------------------------------------+--------------------

Comment (by SimonKing):

 Printing messages to stderr, it seems to me that the error occurs during
 deallocation of a polynomial template, namely in
 sage/rings/polynomial/polynomial_template.pxi:
 {{{
     def __dealloc__(self):
         """
         EXAMPLE::

             sage: P.<x> = GF(2)[]
             sage: del x
         """
         celement_destruct(&self.x,
 get_cparent((<Polynomial_template>self)._parent))
 }}}

 Is the cparent of self deallocated too early (perhaps because the
 refcounting is still not accurate)?

 Or is it a nasty race condition? Namely:

  * A polynomial p in a polynomial ring R is about to be garbage collected.
  * All python stuff is deleted first. In particular, p's reference to its
 parent R is gone.
  * Incidentally, because the reference from p to R is gone, R can now be
 collected as well.
  * When R gets deleted, its underlying libsingular ring is deallocated.
  * Now, `p.__dealloc__` is finally called, and tries to access the
 underlying libsingular ring - but it is too late.

 Question: If a polynomial is created, will the reference counter to the
 underlying libsingular ring be incremented?

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