#14082: PARI stack overflow crashes Sage
----------------------------------+-----------------------------------------
       Reporter:  jdemeyer        |         Owner:  jdemeyer
           Type:  defect          |        Status:  new     
       Priority:  critical        |     Milestone:  sage-5.7
      Component:  c_lib           |    Resolution:          
       Keywords:                  |   Work issues:          
Report Upstream:  N/A             |     Reviewers:          
        Authors:  Jeroen Demeyer  |     Merged in:          
   Dependencies:                  |      Stopgaps:          
----------------------------------+-----------------------------------------
Changes (by {'newvalue': u'Jeroen Demeyer', 'oldvalue': ''}):

  * author:  => Jeroen Demeyer


Old description:

> The following crashes Sage hard:
> {{{
> sage: i = CDF.0
> sage: fz=animate([line([zeta(s+i*t) for t in srange(0,50,0.01)]) for s in
> srange(0,0.9,0.01)],xmin=-1.5,ymin=-2,xmax=2.5,ymax=2)
>   ***   the PARI stack overflows !
>   current stack size: 16000000 (15.259 Mbytes)
>   [hint] you can increase GP stack with allocatemem()
>
>   ***   Error in the PARI system. End of program.
> }}}
>
> The problem is simple: instead of using the '''proper PARI interface'''
> in `sage/libs/pari/gen.pyx`, for some reason PARI is called directly in
> `sage/rings/complex_double.pyx`. This interface misses some features,
> such as cleaning up the PARI stack :-)
>
> This goes back to
> {{{
> changeset:   1292:28dfa54b6a23
> parent:      1273:97f9271f8637
> user:        William Stein <[email protected]>
> date:        Sun Sep 24 23:13:32 2006 -0700
> summary:     Finished the 2nd draft of the double precision complex
> numbers.
> }}}
>
> Solution: use the proper PARI interface instead.

New description:

 The following crashes Sage hard:
 {{{
 sage: i = CDF.0
 sage: fz=animate([line([zeta(s+i*t) for t in srange(0,50,0.01)]) for s in
 srange(0,0.9,0.01)],xmin=-1.5,ymin=-2,xmax=2.5,ymax=2)
   ***   the PARI stack overflows !
   current stack size: 16000000 (15.259 Mbytes)
   [hint] you can increase GP stack with allocatemem()

   ***   Error in the PARI system. End of program.
 }}}

 The problem is simple: instead of using the '''proper PARI interface''' in
 `sage/libs/pari/gen.pyx`, for some reason PARI is called directly in
 `sage/rings/complex_double.pyx`. This interface misses some features, such
 as cleaning up the PARI stack :-)

 I also noticed that all PARI computations in this module use a
 '''precision of 1728 bits''' on 64-bit systems due to a misunderstanding
 of PARI precision (machine words in the PARI library vs. decimal digits in
 GP).

 This code goes back to
 {{{
 changeset:   1292:28dfa54b6a23
 parent:      1273:97f9271f8637
 user:        William Stein <[email protected]>
 date:        Sun Sep 24 23:13:32 2006 -0700
 summary:     Finished the 2nd draft of the double precision complex
 numbers.
 }}}

 Solution: use the proper PARI interface instead.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14082#comment:4>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to