You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Running the tests with CC=-ftrapv shows that #1911 isn't the only overflow-related error and we're thus hitting undefined behaviour in other cases; notably in Overflow.c we often do operations on signed integers regardless of whether or not we're in the overflow case. PR forthcoming.
cython$ CFLAGS=-ftrapv python runtests.py overflow
Python 3.8.2 (default, Apr 8 2020, 14:31:25)
[GCC 9.3.0]
Running tests against Cython 3.0a4 3bba77a2bf9ed7da4c118fd7887658c597e14cd2
Using Cython language level 2.
Backends: c,cpp
Fatal Python error: Aborted
Thread 0x00007fb5bcdce700 (most recent call first):
File "runtests.py", line 2267 in time_stamper
File "/usr/lib/python3.8/threading.py", line 870 in run
File "/usr/lib/python3.8/threading.py", line 932 in _bootstrap_inner
File "/usr/lib/python3.8/threading.py", line 890 in _bootstrap
Current thread 0x00007fb5bdda3740 (most recent call first):
File "<doctest overflow_check_int.test_add_const[1]>", line 1 in <module>
File "/usr/lib/python3.8/doctest.py", line 1329 in __run
File "/usr/lib/python3.8/doctest.py", line 1476 in run
File "/usr/lib/python3.8/doctest.py", line 2191 in runTest
File "/usr/lib/python3.8/unittest/case.py", line 633 in _callTestMethod
File "/usr/lib/python3.8/unittest/case.py", line 676 in run
File "/usr/lib/python3.8/unittest/case.py", line 736 in __call__
File "/usr/lib/python3.8/unittest/suite.py", line 122 in run
File "runtests.py", line 1315 in run_test
File "runtests.py", line 1321 in run_forked_test
File "runtests.py", line 1316 in run_doctests
File "runtests.py", line 1304 in run_tests
File "runtests.py", line 1286 in run
File "/usr/lib/python3.8/unittest/case.py", line 736 in __call__
File "/usr/lib/python3.8/unittest/suite.py", line 122 in run
File "/usr/lib/python3.8/unittest/suite.py", line 84 in __call__
File "/usr/lib/python3.8/unittest/suite.py", line 122 in run
File "/usr/lib/python3.8/unittest/suite.py", line 84 in __call__
File "/usr/lib/python3.8/unittest/suite.py", line 122 in run
File "/usr/lib/python3.8/unittest/suite.py", line 84 in __call__
File "/usr/lib/python3.8/unittest/runner.py", line 176 in run
File "runtests.py", line 2573 in runtests
File "runtests.py", line 2209 in main
File "runtests.py", line 2595 in <module>
Aborted (core dumped)
The text was updated successfully, but these errors were encountered:
gsnedders
changed the title
Overflow failures in tests
overflow_check_* failures in tests
May 8, 2020
gsnedders
added a commit
to gsnedders/cython
that referenced
this issue
May 8, 2020
* Fix#3588: Make existing overflow code safe
Signed overflow is undefined behaviour in C and compilers can and do optimized on that basis.
* Speed up our overflow impls
Note this is primarily based on performance of compilers which do not
support __builtin_add_overflow (i.e., not Clang >= 3.4 & gcc >= 5),
mostly looking at several gcc 4 releases (used by older, supported,
RHEL releases and Debian 8 "Jessie") and MSVC.
* Use __builtin_XXX_overflow if available
This is much quicker in general, as these all just then read the overflow flag from the status register.
Running the tests with CC=-ftrapv shows that #1911 isn't the only overflow-related error and we're thus hitting undefined behaviour in other cases; notably in Overflow.c we often do operations on signed integers regardless of whether or not we're in the overflow case. PR forthcoming.
The text was updated successfully, but these errors were encountered: