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
CentOS 7 GCC 4.8.5 miscompiles optimized build: <built-in function compile> returned NULL without setting an exception #94825
Comments
I believe this is a parallel processing issue. If I try the build multiple time, it does succeed for perhaps 1 out of 3 times. I think some rule needs to be added to the makefile to ensure the site module is built prior it its being needed by other aspects of the build. |
I don't see any job parameters. Do you run The SystemError should not happen. It might be the cause of your problem.
|
All I did was untar the distribution, cd'ed into it and ran: ./configure --enable-optimizations No environment vars were set. 'make' was run without arguments. |
So no parallel builds then. I can reproduce the issue on a CentOS 7.9 machine with GCC 4.8.5.
Python's builtin
The dict looks fine to me:
This might be a compiler bug caused by an invalid optimization. |
|
I can't reproduce the problem with devtoolset 7 and GCC 7.3.1 on CentOS / RHEL 7. This points to a compiler bug with GCC 4.8. |
You can get a more recent GCC version on RHEL 7 and Centos 7 via https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/ for example. IMO Python ./configure script should fail if trying to build Python with an old GCC version known to have compiler bugs. Python 3.11 now requires a C compiler compatible with C11 (without optional) features): |
If someone is very motivated, maybe the faulty GCC optimization can be identified and it can be disabled when building Python 3.11 on old GCC versions (ex: use -O2 instead of -O3). But it sounds like a boring whack-a-mole game :-( |
I have managed to succesfully compile Python 3.11.1 on CentOS 7. I have also managed to trigger this bug, but AFAICT it seems to work fine when doing I configured the build like this basically:
CentOS version: 7.9.2009 (Core), kernel: 3.10.0-1160.81.1.el7.x86_64. GCC version: 4.8.5 20150623 (Red Hat 4.8.5-44). |
jdhedden commentedJul 13, 2022
Bug report
Attempts to build 3.11.0b4 fail with:
Fatal Python error: init_import_site: Failed to import the site module
Commands used:
./configure --enable-optimizations
make
The full error is:
./_bootstrap_python ./Programs/_freeze_module.py abc ./Lib/abc.py Python/frozen_modules/abc.h
Fatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/home/centos/Python-3.11.0b4/Lib/site.py", line 73, in
import os
File "/home/centos/Python-3.11.0b4/Lib/os.py", line 29, in
from _collections_abc import _check_methods
SystemError: returned NULL without setting an exception
make[1]: *** [Python/frozen_modules/abc.h] Error 1
make[1]: Leaving directory `/home/centos/Python-3.11.0b4'
make: *** [profile-opt] Error 2
Your environment
CentOS Linux release 7.9.2009 (Core)
Linux 3.10.0-1160.66.1.el7.x86_64 #1 SMP Wed May 18 16:02:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
EOF
The text was updated successfully, but these errors were encountered: