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

Python bindings check fails on 32-bit #20

Open
dddejan opened this issue Apr 3, 2020 · 0 comments
Open

Python bindings check fails on 32-bit #20

dddejan opened this issue Apr 3, 2020 · 0 comments

Comments

@dddejan
Copy link
Member

dddejan commented Apr 3, 2020

Machine:

dejan@ubuntu-16-04-32bit:~/workspace/libpoly/build$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial
dejan@ubuntu-16-04-32bit:~/workspace/libpoly/build$ uname -a
Linux ubuntu-16-04-32bit 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:19 UTC 2019 i686 i686 i686 GNU/Linux

Cmake:

cmake .. -DCMAKE_INSTALL_PREFIX=/home/dejan/install/ -DCMAKE_BUILD_TYPE=Debug -DPython_ADDITIONAL_VERSIONS=3

Error:

Running python/polynomial_resultants.py:
	* Checking Speed
	* Checking Bugs
OverflowError: Python int too large to convert to C long

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dejan/workspace/libpoly/test/check.py", line 61, in <module>
    sys.exit(main())
  File "/home/dejan/workspace/libpoly/test/check.py", line 50, in main
    forkexec(test, context)
  File "/home/dejan/workspace/libpoly/test/check.py", line 11, in forkexec
    exec(code, env, env)
  File "python/polynomial_resultants.py", line 72, in <module>
    check_psc(p, q, expected)
  File "python/polynomial_resultants.py", line 17, in check_psc
    psc = p.psc(q)
SystemError: <built-in method psc of polypy.Polynomial object at 0xb6804220> returned a result with an error set

The main issue is in

void PyLong_or_Int_to_integer(PyObject* o, lp_int_ring_t* K, lp_integer_t* c) {
where PyLong_AsLong is called without checking for overflow. Same happens in Python 2 but for some reason it doesn't throw an exception.

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

No branches or pull requests

1 participant