[pypy-dev] int_py_mod_nonnegargs(): one arg is negative LLAssertFailure
Armin Rigo
armin.rigo at gmail.com
Fri Dec 9 03:45:33 EST 2016
Hi,
On 9 December 2016 at 02:00, Shubha Ramani via pypy-dev
<pypy-dev at python.org> wrote:
> Why am I getting this error ?
> pidigits.py runs fine outside of the pytest environment.
I'm getting:
from rpython.jit.metainterp.test.support import LLJitMixin,X86JitMixin
E ImportError: cannot import name X86JitMixin
After hacking at that until the test runs (replacing it with
LLJitMixin), then I see the problem. It's likely caused by integer
overflow. Your f() function computes the digits of pi, but it's not
valid RPython because integers overflow the size of C 'long'. An
internal test then fails because although '(n*3 + a) % d' was
supposedly proven to occur on known-nonnegative arguments, the value
did overflow and is now negative. Copying the same algorithm in C
with the type 'long' everywhere would be similarly undefined C code.
Armin
More information about the pypy-dev
mailing list