-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Upgrade python to 3.11 #33842
Comments
comment:2
It builds. First failure: building cython - we need to wait for a version with 3.11 support - https://github.com/cython/cython/commits/0.29.x New commits:
|
Commit: |
comment:3
Cython update in #33864 |
Dependencies: #33864 |
This comment has been minimized.
This comment has been minimized.
comment:6
same error as in memory_allocator |
comment:7
Fix is in 23.0.0 (still beta) https://pyzmq.readthedocs.io/en/latest/changelog.html |
comment:8
cypari2:
|
comment:10
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:15
This should be fixed in FPyLLL upstream. I can cut new packages? |
comment:16
Yes please! |
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
|
comment:19
See #33913 for FP(y)LLL |
comment:139
I still get the
on macOS Big Sur, so I guess it wasn't fixed in #34795 PS: Indeed the offending line is here
PPS: Buildbot locale is:
|
comment:140
Thanks for the details. I think we'll have to suppress the warning. I'll also open an issue with docutils |
comment:141
|
Changed branch from u/tornaria/py311 to u/mkoeppe/py311 |
New commits:
|
comment:144
Replying to Matthias Köppe:
That's now https://sourceforge.net/p/docutils/bugs/464/ |
comment:145
|
Changed branch from u/mkoeppe/py311 to |
This is needed for python 3.11 support (sagemath#33842) and to make cypari compatible with current pari version https://groups.google.com/g/sage-devel/c/jqmr6bDjDrk/m/XE2GlB_GBgAJ Necessary follow ups: - make cypari thread safe: see [[https://github.com/sagemath/cypari2/pull/116|cypari2 sagemath#116]] - remove optional build time dependency of cysignals on pari: see [[https://github.com/sagemath/cypari2/pull/130|cypari2 sagemath#130]] URL: https://trac.sagemath.org/33878 Reported by: gh-kliem Ticket author(s): Matthias Koeppe Reviewer(s): Dima Pasechnik
This affects 32 bit architectures, where the representation of python integers changed in cpython 3.11. As part of sagemath#33842, the function `sage.arith.long.integer_check_long_py()` was rewritten to support the new representation. Unfortunately a bug remains for the conversion of integers between 2^60 and 2^63-1. This manifests in lots of doctests failing, but a quick way to demonstrate the issue is sage: ZZ ( int(1152921504606847018) ) # 2^60 + 42 42 The function `integer_check_long_py()` has good unit testing, checking values around the word size, but this range was missing. This commit adds a simple fix and new test cases for a few integers in this range.
This affects 32 bit architectures, where the representation of python integers changed in cpython 3.11, when compiled with gcc12. As part of sagemath#33842, the function `sage.arith.long.integer_check_long_py()` was rewritten to support the new representation. Unfortunately a bug remained that triggers UB for the conversion of integers between 2^60 and 2^63-1. Alas, the undesired behaviour does not happen with gcc10; it only started when I switched to gcc12. The bug manifests in lots of doctests failing, but a quick way to demonstrate the issue is sage: ZZ ( int(1152921504606847018) ) # 2^60 + 42 42 The function `integer_check_long_py()` has good unit testing, checking values around the word size, but this range was missing. This commit adds a simple fix and new test cases for a few integers in this range. Technical explanation: The UB is in the line cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT) In our case we have `BITS_IN_LONG == 31` and `PyLong_SHIFT == 30` so the computed value is `<long>1 << -29` which is UB and it happens to evaluate to 0 with gcc10 but 8 with gcc12. The solution is to set the value to 0 when `BITS_IN_LONG < 2 * PyLong_SHIFT`.
This affects 32 bit architectures, where the representation of python integers changed in cpython 3.11, when compiled with gcc12. As part of sagemath#33842, the function `sage.arith.long.integer_check_long_py()` was rewritten to support the new representation. Unfortunately a bug remained that triggers UB for the conversion of integers between 2^60 and 2^63-1. Alas, the undesired behaviour does not happen with gcc10; it only started when I switched to gcc12. The bug manifests in lots of doctests failing, but a quick way to demonstrate the issue is sage: ZZ ( int(1152921504606847018) ) # 2^60 + 42 42 The function `integer_check_long_py()` has good unit testing, checking values around the word size, but this range was missing. This commit adds a simple fix and new test cases for a few integers in this range. Technical explanation: The UB is in the line cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT) In our case we have `BITS_IN_LONG == 31` and `PyLong_SHIFT == 30` so the computed value is `<long>1 << -29` which is UB and it happens to evaluate to 0 with gcc10 but 8 with gcc12. The solution is to set the value to 0 when `BITS_IN_LONG < 2 * PyLong_SHIFT`.
….11, 32 bit) This affects 32 bit architectures, where the representation of python integers changed in cpython 3.11, when compiled with gcc12. As part of sagemath#33842, the function `sage.arith.long.integer_check_long_py()` was rewritten to support the new representation. Unfortunately a bug remained that triggers UB for the conversion of integers between 2^60 and 2^63-1. Alas, the undesired behaviour does not happen with gcc10; it only started when I switched to gcc12. The bug manifests in lots of doctests failing, but a quick way to demonstrate the issue is sage: ZZ ( int(1152921504606847018) ) # 2^60 + 42 42 The function `integer_check_long_py()` has good unit testing, checking values around the word size, but this range was missing. This commit adds a simple fix and new test cases for a few integers in this range. Technical explanation: The UB is in the line cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT) In our case we have `BITS_IN_LONG == 31` and `PyLong_SHIFT == 30` so the computed value is `<long>1 << -29` which is UB and it happens to evaluate to 0 with gcc10 but 8 with gcc12. The solution is to set the value to 0 when `BITS_IN_LONG < 2 * PyLong_SHIFT`.
…on 3.11, 32 bit, gcc12) This affects 32 bit architectures, where the representation of python integers changed in cpython 3.11, when compiled with gcc12. As part of #33842, the function `sage.arith.long.integer_check_long_py()` was rewritten to support the new representation. Unfortunately a bug remained that triggers UB for the conversion of integers between 2^60 and 2^63-1. Alas, the undesired behaviour does not happen with gcc10; it only started when I switched to gcc12. The bug manifests in lots of doctests failing, but a quick way to demonstrate the issue is sage: ZZ ( int(1152921504606847018) ) # 2^60 + 42 42 The function `integer_check_long_py()` has good unit testing, checking values around the word size, but this range was missing. This commit adds a simple fix and new test cases for a few integers in this range. Technical explanation: The UB is in the line cdef long lead_3_overflow = (<long>1) << (BITS_IN_LONG - 2 * PyLong_SHIFT) In our case we have `BITS_IN_LONG == 31` and `PyLong_SHIFT == 30` so the computed value is `<long>1 << -29` which is UB and it happens to evaluate to 0 with gcc10 but 8 with gcc12. The solution is to set the value to 0 when `BITS_IN_LONG < 2 * PyLong_SHIFT` (which only happens for 32 bit python 3.11) --- TESTING: - With gcc10 the fix in #33842 was extensively tested (e.g. in void-linux/void-packages#41085) and everything seemed ok, that's why we missed this bug. - When using gcc 12, without this PR around 200 tests fail on 32 bit. - With this PR all tests pass as shown in https://github.com/void- linux/void-packages/pull/42048 (I'm actually testing sagemath-9.7 with python 3.11 support backported since that's easier for me, but it shouldn't make a difference). URL: #34997 Reported by: Gonzalo Tornaría Reviewer(s): Gonzalo Tornaría, Matthias Köppe
Issues
Depends on #32423
Depends on #33530
Depends on #33878
Depends on #34795
CC: @kiwifb @antonio-rojas @nbruin @dimpase @jhpalmieri
Component: packages: standard
Author: Gonzalo Tornaría, Matthias Koeppe, Andrey Belgorodski
Branch/Commit:
ac0105e
Reviewer: Matthias Koeppe, Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/33842
The text was updated successfully, but these errors were encountered: