#715: Parents probably not reclaimed due to too much caching
-------------------------------------------------------------------+--------
       Reporter:  robertwb                                         |         
Owner:  somebody                                 
           Type:  defect                                           |        
Status:  needs_work                               
       Priority:  major                                            |     
Milestone:  sage-5.4                                 
      Component:  coercion                                         |    
Resolution:                                           
       Keywords:  weak cache coercion Cernay2012                   |   Work 
issues:                                           
Report Upstream:  N/A                                              |     
Reviewers:  Jean-Pierre Flori, Simon King, Nils Bruin
        Authors:  Simon King, Jean-Pierre Flori                    |     Merged 
in:                                           
   Dependencies:  #9138, #11900, #11599, to be merged with #11521  |      
Stopgaps:                                           
-------------------------------------------------------------------+--------
Changes (by SimonKing):

  * status:  positive_review => needs_work


Comment:

 There are sporadic segfaults found by some (not all) patchbots on #11370
 and #12876 that seem to be related with the weak caching bits.

 Here, the cdef attribute `sage.categories.action.Action.S` (that's for
 keeping the underlying set of the action) is turned into a weak reference
 to the underlying set. Today, I found that there might be an interference
 with old code in sage/rings/morphism.pyx, namely:
 {{{
 cdef class RingHomomorphism(RingMap):
     def __init__(self, R, S):
         """
         Create a lifting ring map.

         EXAMPLES::

             sage: f = Zmod(8).lift()          # indirect doctest
             sage: f(3)
             3
             sage: type(f(3))
             <type 'sage.rings.integer.Integer'>
             sage: type(f)
             <type 'sage.rings.morphism.RingMap_lift'>
         """
         from sage.categories.sets_cat import Sets
         H = R.Hom(S, Sets())
         RingMap.__init__(self, H)
         self.S = S  # for efficiency
         try:
             S._coerce_(R(0).lift())
         except TypeError:
             raise TypeError, "No natural lift map"

     cdef _update_slots(self, _slots):
         self.S = _slots['S']
         Morphism._update_slots(self, _slots)

     cdef _extra_slots(self, _slots):
         _slots['S'] = self.S
         return Morphism._extra_slots(self, _slots)

 }}}
 Hence, `RingHomomorphism` uses the S attribute as well, but differently.
 And aren't there actions that are ring homomorphisms?

 I think it is worth trying to rename the `S` attribute of Action. I put it
 to "needs work", because I doubt that flaky segfaults are acceptable.

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