#715: Parents probably not reclaimed due to too much caching
-------------------------------------------------------------------+--------
       Reporter:  robertwb                                         |         
Owner:  somebody                                 
           Type:  defect                                           |        
Status:  needs_review                             
       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:                                           
-------------------------------------------------------------------+--------

Comment (by nbruin):

 Continuing on the bisection tour: While the argument above was sound (the
 memory corruption must happen before the segfault), the following is a
 heuristic: We observed that letting a doctest print/fail early in the file
 prevents the segfault from happening. This could be because such a print
 changes the memory layout (triggers a GC or something like that) and hence
 the corruption that is still to come, happens in a different place and
 doesn't lead to a segfault. This idea seems surprisingly robust in
 practice: If you add failing doctests below a certain point, you have the
 segfault in the place pointed out above. If you add failing doctests
 before a certain point, no segfault happens. The hypothesis is now that
 the crossover point is where the corruption happens. It's in example_21:
 {{{
 ...
         This class is a pickle. However, sometimes, pickles
         need to be pickled another time.

         TEST::

             >>> PF = WeylGroup(['A',Integer(3)]).pieri_factors()###line
 846:_sage_    >>> PF = WeylGroup(['A',3]).pieri_factors()
             >>> a = PF.an_element()###line 847:_sage_    >>> a =
 PF.an_element()
             >>> 1
             NOT THIS
             >>> a.bruhat_lower_covers()###line 848:_sage_    >>>
 a.bruhat_lower_covers()
 ...
 }}}
 With this in place, a segfault still happens. If I move the failing
 doctest before `PF.an_element`, we don't get a segfault. So perhaps that
 routine is to blame? Missing refcount increase perhaps?

 Once again, this is only heuristic! I have no proof. It's just that around
 this location, segfaulting seems to react to changes.

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