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.Dismiss alert
{{ message }}
Repository navigation
memoryview rely on _Bool undefined behavior (test_buffer fails on Python built with GCC 11) #86753
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-01-04.11:58:06.897>created_at=<Date2020-12-07.15:00:21.718>labels= ['tests', '3.9', '3.10']
title='memoryview rely on _Bool undefined behavior (test_buffer fails on Python built with GCC 11)'updated_at=<Date2021-01-04.11:58:06.896>user='https://github.com/vstinner'
On Python 3.6/x86-64, Python does crash in libregrtest while loading test_code:
0:01:13 load avg: 2.23 [ 56/406] test_code
Fatal Python error: Segmentation fault
Current thread 0x00007f5a6864d740 (most recent call first):
File "/builddir/build/BUILD/Python-3.6.12/Lib/test/test_code.py", line 288 in <module>
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 678 in exec_module
File "<frozen importlib._bootstrap>", line 665 in _load_unlocked
File "<frozen importlib._bootstrap>", line 955 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 971 in _find_and_load
File "<frozen importlib._bootstrap>", line 994 in _gcd_import
File "/builddir/build/BUILD/Python-3.6.12/Lib/importlib/init.py", line 126 in import_module
(...)
On Python 3.5/x86-64, test_ctypes.test_callbacks() crashs with a SIGSEGV:
changed the title [-]test_buffer fails on Python built with GCC 11[/-][+]memoryview rely on _Bool undefined behavior (test_buffer fails on Python built with GCC 11)[/+]on Dec 8, 2020
changed the title [-]test_buffer fails on Python built with GCC 11[/-][+]memoryview rely on _Bool undefined behavior (test_buffer fails on Python built with GCC 11)[/+]on Dec 8, 2020
Activity
vstinner commentedon Dec 7, 2020
PPC64LE Fedora Rawhide LTO 3.x:
https://buildbot.python.org/all/#/builders/448/builds/433
FAIL: test_memoryview_cast (test.test_buffer.TestBufferProtocol)
FAIL: test_memoryview_cast_1D_ND (test.test_buffer.TestBufferProtocol)
FAIL: test_memoryview_compare_random_formats (test.test_buffer.TestBufferProtocol)
FAIL: test_ndarray_format_shape (test.test_buffer.TestBufferProtocol)
FAIL: test_ndarray_format_strides (test.test_buffer.TestBufferProtocol)
FAIL: test_ndarray_getbuf (test.test_buffer.TestBufferProtocol)
FAIL: test_ndarray_index_getitem_single (test.test_buffer.TestBufferProtocol)
FAIL: test_ndarray_random (test.test_buffer.TestBufferProtocol)
FAIL: test_ndarray_slice_assign_single (test.test_buffer.TestBufferProtocol)
Example:
FAIL: test_ndarray_slice_assign_single (test.test_buffer.TestBufferProtocol)
----------------------------------------------------------------------
vstinner commentedon Dec 7, 2020
On Python 3.6/x86-64, Python does crash in libregrtest while loading test_code:
0:01:13 load avg: 2.23 [ 56/406] test_code
Fatal Python error: Segmentation fault
Current thread 0x00007f5a6864d740 (most recent call first):
File "/builddir/build/BUILD/Python-3.6.12/Lib/test/test_code.py", line 288 in <module>
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 678 in exec_module
File "<frozen importlib._bootstrap>", line 665 in _load_unlocked
File "<frozen importlib._bootstrap>", line 955 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 971 in _find_and_load
File "<frozen importlib._bootstrap>", line 994 in _gcd_import
File "/builddir/build/BUILD/Python-3.6.12/Lib/importlib/init.py", line 126 in import_module
(...)
On Python 3.5/x86-64, test_ctypes.test_callbacks() crashs with a SIGSEGV:
test_callbacks (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ...
Fatal Python error: Segmentation fault
Current thread 0x00007f5de8322740 (most recent call first):
File "/builddir/build/BUILD/Python-3.5.10/Lib/ctypes/test/test_as_parameter.py", line 90 in test_callbacks
The strange part is that the test suite pass on some platforms depending on the Python version.
It might be a GCC 11 regression.
vstinner commentedon Dec 7, 2020
Copy of Miro Hrončok's email to Fedora python-devel list:
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/ADKCB6HXGZHJPYX5LSJ7422FITYSOAL3/
----
Hello.
I've been notified that many of the Python interpreters started to fail with new
GNU Toolchain (gcc 11, glibc 2.33).
https://koschei.fedoraproject.org/package/pythonX.Y (replace X.Y with version)
Python 3.5
Python 3.6
Python 3.7
Python 3.8
Python 3.9
Python 3.10
PyPys have not yet been collected by Koschei, Python 2.7 seems fine.
----
Python is built with LTO+PGO on Fedora.
vstinner commentedon Dec 7, 2020
test_buffer also fails with GCC 11 on Python 3.8 built without LTO nor PGO, just -Og (./configure --enable-pydebug).
PPC64LE Fedora Rawhide Refleaks 3.8:
https://buildbot.python.org/all/#/builders/398/builds/101
test.pythoninfo:
sysconfig[CFLAGS]: -Wno-unused-result -Wsign-compare -g -Og -Wall
sysconfig[PY_CFLAGS]: -Wno-unused-result -Wsign-compare -g -Og -Wall
sysconfig[PY_CFLAGS_NODIST]: -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include/internal
sysconfig[PY_STDMODULE_CFLAGS]: -Wno-unused-result -Wsign-compare -g -Og -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include/internal -I. -I./Include
Note: I'm not sure why test.pythoninfo didn't log LDFLAGS? It's supposed to log them.
vstinner commentedon Dec 7, 2020
It might be related to _Bool. See also bpo-39689.
vstinner commentedon Dec 8, 2020
On AArch64, GCC 11 miscompiles unpack_cmp() of Objects/memoryview.c for the '?' case:
I reported the bug to GCC upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98190
vstinner commentedon Dec 8, 2020
See also: Behavior of struct “?” format (native _Bool)
https://discuss.python.org/t/behavior-of-struct-format-native-bool/3774
[-]test_buffer fails on Python built with GCC 11[/-][+]memoryview rely on _Bool undefined behavior (test_buffer fails on Python built with GCC 11)[/+][-]test_buffer fails on Python built with GCC 11[/-][+]memoryview rely on _Bool undefined behavior (test_buffer fails on Python built with GCC 11)[/+]vstinner commentedon Dec 14, 2020
GCC got a fix:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3e60ddeb8220ed388819bb3f14e8caa9309fd3c2
vstinner commentedon Jan 4, 2021
The Fedora package gcc-11.0.0-0.11 includes https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3e60ddeb8220ed388819bb3f14e8caa9309fd3c2 fix for the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98190 bug.
vstinner commentedon Jan 4, 2021
"PPC64LE Fedora Rawhide LTO 3.x" buildbot is back to green. test.pythoninfo now says:
CC.version: gcc (GCC) 11.0.0 20201223 (Red Hat 11.0.0-0)