Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PARI stack overflow crashes Sage #14082

Closed
jdemeyer opened this issue Feb 8, 2013 · 11 comments
Closed

PARI stack overflow crashes Sage #14082

jdemeyer opened this issue Feb 8, 2013 · 11 comments

Comments

@jdemeyer
Copy link

jdemeyer commented Feb 8, 2013

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 code goes back to

changeset:   1292:28dfa54b6a23
parent:      1273:97f9271f8637
user:        William Stein <wstein@gmail.com>
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.

Depends on #13618

Component: c_lib

Author: Jeroen Demeyer

Reviewer: David Roe

Merged: sage-5.8.beta3

Issue created by migration from https://trac.sagemath.org/ticket/14082

@jdemeyer jdemeyer added this to the sage-5.8 milestone Feb 8, 2013
@jdemeyer jdemeyer self-assigned this Feb 8, 2013
@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link
Author

jdemeyer commented Feb 8, 2013

Author: Jeroen Demeyer

@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@roed314
Copy link
Contributor

roed314 commented Feb 24, 2013

Reviewer: David Roe

@roed314
Copy link
Contributor

roed314 commented Feb 24, 2013

comment:7

This looks good, and the following change means that our eta function now agrees with Mathematica (and PARI as well)

-            sage: CDF(10^15,0.1).eta()     # slightly random-ish arch dependent output
-            -0.121339721991 - 0.19619461894*I   
+            sage: CDF(10^15, 0.1).eta()  # abs tol 1e-10
+            -0.115342592727 - 0.19977923088*I

@jdemeyer
Copy link
Author

Dependencies: #13618

@jdemeyer
Copy link
Author

comment:8

Attachment: 14082_pari_complex_double.patch.gz

Rebased.

@jdemeyer
Copy link
Author

jdemeyer commented Mar 4, 2013

Merged: sage-5.8.beta3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants