#12313: Fix yet another memory leak caused by caching of coercion data
-------------------------------------------------+--------------------------
       Reporter:  SimonKing                      |         Owner:  rlm          
                            
           Type:  defect                         |        Status:  
positive_review                          
       Priority:  major                          |     Milestone:  sage-5.1     
                            
      Component:  memleak                        |    Resolution:               
                            
       Keywords:  coercion weak dictionary       |   Work issues:               
                            
Report Upstream:  N/A                            |     Reviewers:  Simon King, 
Jean-Pierre Flori, John Perry
        Authors:  Simon King, Jean-Pierre Flori  |     Merged in:               
                            
   Dependencies:  #715, #11521, #11599           |      Stopgaps:               
                            
-------------------------------------------------+--------------------------

Comment (by jdemeyer):

 I get some rare doctest failures while testing a very preliminary version
 of sage-5.1.beta1.  The annoying thing is that the tests aren't
 reproducible.  The problems seem to be related to coercion.  I'm only
 guessing this ticket is to blame, it could also be #12877 or some other
 ticket listed in
 [http://boxen.math.washington.edu/home/release/sage-5.1.beta1/tickets.html]

 All the observed failures have been within the
 `sage/schemes/elliptic_curves` directory.

 Often one just gets a segmentation fault:
 {{{
 sage -t  --long -force_lib
 devel/sage/sage/schemes/elliptic_curves/heegner.py
 Segmentation fault

          [101.7 s]
 }}}

 But there are also failures of the form:
 {{{
 sage -t  --long -force_lib
 devel/sage/sage/schemes/elliptic_curves/ell_tate_curve.py
 **********************************************************************
 File
 "/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/devel
 /sage-main/sage/schemes/elliptic_curves/ell_tate_curve.py", line 332:
     sage: eq.parametrisation_onto_tate_curve(1+5+5^2+O(5^10))
 Exception raised:
     Traceback (most recent call last):
       File
 
"/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/local/bin/ncadoctest.py",
 line 1231, in run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File
 
"/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/local/bin/sagedoctest.py",
 line 38, in run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File
 
"/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/local/bin/ncadoctest.py",
 line 1172, in run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_12[3]>", line 1, in <module>
 
eq.parametrisation_onto_tate_curve(Integer(1)+Integer(5)+Integer(5)**Integer(2)+O(Integer(5)**Integer(10)))###line
 332:
     sage: eq.parametrisation_onto_tate_curve(1+5+5^2+O(5^10))
       File
 
"/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/local/lib/python
 /site-packages/sage/schemes/elliptic_curves/ell_tate_curve.py", line 340,
 in parametrisation_onto_tate_curve
         un = u * q**(-(u.valuation()/q.valuation()).floor())
       File "element.pyx", line 1687, in
 sage.structure.element.RingElement.__mul__
 (sage/structure/element.c:12755)
       File "coerce.pyx", line 797, in
 sage.structure.coerce.CoercionModel_cache_maps.bin_op
 (sage/structure/coerce.c:7555)
     TypeError: unsupported operand parent(s) for '*': '5-adic Ring with
 capped relative precision 20' and '5-adic Field with capped relative
 precision 20'
 **********************************************************************
 File
 "/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/devel
 /sage-main/sage/schemes/elliptic_curves/ell_tate_curve.py", line 529:
     sage: eq.parametrisation_onto_original_curve(1+5+5^2+O(5^10))
 Exception raised:
     Traceback (most recent call last):
       File
 
"/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/local/bin/ncadoctest.py",
 line 1231, in run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File
 
"/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/local/bin/sagedoctest.py",
 line 38, in run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File
 
"/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/local/bin/ncadoctest.py",
 line 1172, in run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_17[3]>", line 1, in <module>
 
eq.parametrisation_onto_original_curve(Integer(1)+Integer(5)+Integer(5)**Integer(2)+O(Integer(5)**Integer(10)))###line
 529:
     sage: eq.parametrisation_onto_original_curve(1+5+5^2+O(5^10))
       File
 
"/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/local/lib/python
 /site-packages/sage/schemes/elliptic_curves/ell_tate_curve.py", line 545,
 in parametrisation_onto_original_curve
         P = self.parametrisation_onto_tate_curve(u,prec=20)
       File
 
"/Users/buildbot/build/sage/bsd-1/bsd_64_full/build/sage-5.1.beta1/local/lib/python
 /site-packages/sage/schemes/elliptic_curves/ell_tate_curve.py", line 340,
 in parametrisation_onto_tate_curve
         un = u * q**(-(u.valuation()/q.valuation()).floor())
       File "element.pyx", line 1687, in
 sage.structure.element.RingElement.__mul__
 (sage/structure/element.c:12755)
       File "coerce.pyx", line 797, in
 sage.structure.coerce.CoercionModel_cache_maps.bin_op
 (sage/structure/coerce.c:7555)
     TypeError: unsupported operand parent(s) for '*': '5-adic Ring with
 capped relative precision 20' and '5-adic Field with capped relative
 precision 20'
 **********************************************************************
 }}}
 I have also seen an error similar to the above but with multiplying
 `RealNumber`s, but I didn't copy the exact error message.

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