#12215: Memleak in UniqueRepresentation, @cached_method
-----------------------+----------------------------------------------------
   Reporter:  vbraun   |          Owner:  rlm                                   
    
       Type:  defect   |         Status:  needs_review                          
    
   Priority:  major    |      Milestone:  sage-4.8                              
    
  Component:  memleak  |       Keywords:  UniqueRepresentation cached_method 
caching
Work_issues:           |       Upstream:  N/A                                   
    
   Reviewer:           |         Author:  Simon King                            
    
     Merged:           |   Dependencies:  #11115 #11900                         
    
-----------------------+----------------------------------------------------
Changes (by SimonKing):

 * cc: vbraun (added)


Comment:

 Cc to Volker, because I expect he has enough knowledge to give me some
 advice on how I could trace down the following segfault.

 With #12313 and the patch from here, `sage -t -verbose -force_lib
 "devel/sage/doc/en/bordeaux_2008/half_integral.rst"` segfaults. By
 inspection of the core file, I found that the segfault occurs during
 deallocation of a functor.

 For debugging, I added a `__dealloc__` method to
 `sage.categories.functor.Functor` that writes the type and the address of
 self and of the two cdef attributes `__domain` and `__codomain` to some
 file. The same is done during initialisation of the functor.

 And the last lines of the resulting file (before the segfault) are:
 {{{
 Dealloc Functor <type 'sage.structure.coerce_actions.LeftModuleAction'> at
 71023056
   Domain <class 'sage.categories.groupoid.Groupoid'> at 75636560
   Codom. <class 'sage.categories.commutative_rings.CommutativeRings'> at
 15429144
 Dealloc Functor <type 'sage.structure.coerce_actions.LeftModuleAction'> at
 71023056
   Domain <type 'NoneType'> at 140661532564960
   Codom. <type 'NoneType'> at 140661532564960
 }}}

 In other words, the functor is deallocated twice, which is a legitimate
 reason to segfault.

 How can I find out why Sage tries to deallocate it twice?

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