Closed vbraun closed 4 years ago
The "exception: exponent too large to convert to mpfr" is coming from arb. It should have called flint_abort which is just a define for abort and terminated the process, but for some reason it didnt. The final 2 is printed, too.
New commits:
6859145 | Fix some places where arb/mpfr conversion of python ints can break on Py3 |
Backtrace:
/home/buildbot/slave/sage_git/build/local/lib/libarb.so.2(arf_get_mpfr+0x13d)[0xd0b5657d]
/home/buildbot/slave/sage_git/build/local/lib/libarb.so.2(arb_get_interval_mpfr+0x85)[0xd0bc29d5]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/rings/real_arb.cpython-37m-i386-linux-gnu.so(+0x16d4e)[0xd0ac6d4e]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/rings/complex_arb.cpython-37m-i386-linux-gnu.so(+0x48d29)[0xd0a6ad29]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/rings/complex_arb.cpython-37m-i386-linux-gnu.so(+0x4949f)[0xd0a6b49f]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/structure/coerce_maps.cpython-37m-i386-linux-gnu.so(+0xd3c5)[0xf5f533c5]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/structure/coerce_maps.cpython-37m-i386-linux-gnu.so(+0x17b97)[0xf5f5db97]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/structure/parent.cpython-37m-i386-linux-gnu.so(+0x1326e)[0xf646426e]
/home/buildbot/slave/sage_git/build/local/lib/libpython3.7m.so.1.0(+0xc37b3)[0xf7cca7b3]
/home/buildbot/slave/sage_git/build/local/lib/libpython3.7m.so.1.0(+0x713a7)[0xf7c783a7]
/home/buildbot/slave/sage_git/build/local/lib/libarb.so.2(arf_get_mpfr+0x13d)[0xd0b5657d]
/home/buildbot/slave/sage_git/build/local/lib/libarb.so.2(arb_get_interval_mpfr+0xa7)[0xd0bc29f7]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/rings/real_arb.cpython-37m-i386-linux-gnu.so(+0x16d4e)[0xd0ac6d4e]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/rings/complex_arb.cpython-37m-i386-linux-gnu.so(+0x48d29)[0xd0a6ad29]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/rings/complex_arb.cpython-37m-i386-linux-gnu.so(+0x4949f)[0xd0a6b49f]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/structure/coerce_maps.cpython-37m-i386-linux-gnu.so(+0xd3c5)[0xf5f533c5]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/structure/coerce_maps.cpython-37m-i386-linux-gnu.so(+0x17b97)[0xf5f5db97]
/home/buildbot/slave/sage_git/build/local/lib/python3.7/site-packages/sage/structure/parent.cpython-37m-i386-linux-gnu.so(+0x1326e)[0xf646426e]
[...]
The error comes from evaluating
exp(cos(x)).subs({x: CIF(-50.3035873016558,- 25.1526638467043)})
when testing whether a certain coefficient of the differential form is zero. This value cannot be represented in 32-bit mpfr, we catch the exception and continue testing at a different point. I think this part just works as intended.
The problem is simply that arb writes 'exception: exponent too large to convert to mpfr2' to its stderr, which may or may not be captured in the doctest stderr stream.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
aabb1ce | Fix some places where arb/mpfr conversion of python ints can break on Py3 |
Branch pushed to git repo; I updated commit sha1. New commits:
7ee4a81 | Silence the arb error message |
Author: Volker Braun
Ticket retargeted after milestone closed
This happens almost always on the buildbot...
Looks to me like the right fix, though it could be a bit surprising that some of these methods accept Python ints only if they're within intmax, even if they could work with arbitrary sized ints.
This pattern from sage.rings.integer might be good to use elsewhere as well:
if is_small_python_int(b):
tmp = b
if (tmp & 1) == 0:
raise ValueError("Jacobi symbol not defined for even b.")
return mpz_kronecker_si(self.value, tmp)
if not isinstance(b, Integer):
b = Integer(b)
Yeah, for example ComplexBall.pow
is giving inconsistent results between 2^65
and int(2^65)
. Fix+test incoming...
Changed author from Volker Braun to Volker Braun, Erik M. Bray
Thanks, looks good to me
Reviewer: Erik M. Bray, Volker Braun
I'm getting:
sage -t --long --warn-long 36.1 src/sage/rings/real_arb.pyx
**********************************************************************
File "src/sage/rings/real_arb.pyx", line 2876, in sage.rings.real_arb.RealBall.__pow__
Failed example:
RBF(e)**(-1r)
Expected:
[0.367879441171442 +/- ...e-16]
Got:
[1.792143500744e-187 +/- 5.50e-200]
**********************************************************************
File "src/sage/rings/real_arb.pyx", line 2888, in sage.rings.real_arb.RealBall.__pow__
Failed example:
RBF(e)^int(2^65)
Expected:
[+/- ...e+16022638320587143290]
Got:
[+/- 2.79e+16022638320587144275]
**********************************************************************
1 item had failures:
2 of 14 in sage.rings.real_arb.RealBall.__pow__
[560 tests, 2 failures, 0.23 s]
----------------------------------------------------------------------
sage -t --long --warn-long 36.1 src/sage/rings/real_arb.pyx # 2 doctests failed
----------------------------------------------------------------------
I also got yet another exception: exponent too large to convert to mpfr2
, so I'll patch out the other occurence in arb as well.
Branch pushed to git repo; I updated commit sha1. New commits:
daa6f8c | Remove remaining "exponent too large to convert to mpfr" |
Erik, are you going to work on the test failures that your patch introduced? If not I suggest we move it to a different ticket...
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
dc3df3a | Remove remaining "exponent too large to convert to mpfr" |
Eric's commit is moved to #29137
Upstream: Not yet reported upstream; Will do shortly.
not reported upstream?
reported: https://github.com/fredrik-johansson/arb/issues/302
As usual, the question is whether it's really needed to deviate from upstream here.
I don't have time to always check each 32-bit buildbot whether it tripped over this issue again, so unless you want to do that job its needed.
OK, good. Hopefully the arb patch won't be needed after Fredrik improves API...
Changed reviewer from Erik M. Bray, Volker Braun to Erik M. Bray, Volker Braun, Dima Pasechnik
Changed branch from public/exponent_too_large_to_convert_to_mpfr2__32bit to dc3df3a
Changed reviewer from Erik M. Bray, Volker Braun, Dima Pasechnik to Erik Bray, Volker Braun, Dima Pasechnik
Changed author from Volker Braun, Erik M. Bray to Volker Braun, Erik Bray
This happens often, but not always when testing on 32-bit:
Upstream: Not yet reported upstream; Will do shortly.
CC: @wbhart @fredrik-johansson @EmmanuelCharpentier
Component: basic arithmetic
Author: Volker Braun, Erik Bray
Branch:
dc3df3a
Reviewer: Erik Bray, Volker Braun, Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/28817