SEGV in mpmath.findroot

37 views
Skip to first unread message

Georgi Guninski

unread,
Oct 1, 2012, 10:19:48 AM10/1/12
to sage-s...@googlegroups.com
import mpmath
mpmath.mp.pretty=True
mpmath.mp.dps=30
def F(x):
return mpmath.zeta(x)+mpmath.zeta(x,derivative=1)

r=mpmath.findroot(F,[0.1+mpmath.j],solver="muller")

====
Unhandled SIGSEGV: A segmentation fault occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.
=====

D. S. McNeil

unread,
Oct 1, 2012, 10:35:37 AM10/1/12
to sage-s...@googlegroups.com
Hmm. My backtrace showed:

/home/mcneil/sagedev/sage-5.4.beta0/local/lib/libcsage.so(print_backtrace+0x3b)[0xb6bd7c49]
/home/mcneil/sagedev/sage-5.4.beta0/local/lib/libcsage.so(sigdie+0x17)[0xb6bd7c89]
/home/mcneil/sagedev/sage-5.4.beta0/local/lib/libcsage.so(sage_signal_handler+0x212)[0xb6bd778c]
[0xb772c400]
/home/mcneil/sagedev/sage-5.4.beta0/local/lib/libgmp.so.7(__gmpn_rshift+0x19c)[0xb6b897dc]

and my standard Python version of mpmath, which I don't think is
gmp-aware, produces

/usr/local/lib/python2.7/dist-packages/mpmath/libmp/libelefun.pyc in
exp_fixed(x, prec, ln2)
1410 return v << n
1411 else:
-> 1412 return v >> (-n)
1413
1414

OverflowError: long int too large to convert to int


Doug

Georgi Guninski

unread,
Oct 1, 2012, 10:58:46 AM10/1/12
to sage-s...@googlegroups.com
i get the same exception on standalone mpmath, don't know if it uses
gmp.

Fredrik Johansson

unread,
Oct 2, 2012, 5:50:46 AM10/2/12
to sage-s...@googlegroups.com, guni...@guninski.com

I have (hopefully) fixed the the crash in mpmath-git.

You still have a problem with your code: the root finder doesn't seem to be converging, so the evaluation points ends up far out in the complex plane. If it doesn't crash, it's still fairly soon going to take extremely long time or run out of memory. I would add a line to F to raise an exception if x doesn't look sane.

Fredrik

Reply all
Reply to author
Forward
0 new messages