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
Building Python 3.12 on ppc32 fail with: Fatal Python error: _PyInterpreterState_GET: the function must be called with the GIL held #106428
Comments
I've been able to bisect it to f8abfa3. |
I wonder if I made a mistake earlier with the initial UBSAN output (because I had to hack it in for reasons unrelated to this bug, this is it done properly - wonder if something like the instrumentation wasn't in all the objects): LD_LIBRARY_PATH=/root/cpython ./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Python/sysmodule.c:196:25: runtime error: member access within misaligned address 0x06969183 for type 'struct PyThreadState', which requires 8 byte alignment
0x06969183: note: pointer points here
<memory cannot be printed>
#0 0xf76dbf44 in sys_audit_tstate Python/sysmodule.c:196
#1 0xf76de824 in _PySys_Audit Python/sysmodule.c:312
#2 0xf76bf640 in PyInterpreterState_New Python/pystate.c:709
#3 0xf76bc68c in pycore_create_interpreter Python/pylifecycle.c:628
#4 0xf76bc68c in pyinit_config Python/pylifecycle.c:891
#5 0xf76bc68c in pyinit_core Python/pylifecycle.c:1060
#6 0xf76bca20 in Py_InitializeFromConfig Python/pylifecycle.c:1256
#7 0xf76bca20 in Py_InitializeFromConfig Python/pylifecycle.c:1241
#8 0xf76ff45c in pymain_init Modules/main.c:67
#9 0xf7700aa8 in pymain_main Modules/main.c:710
#10 0xf7700bd8 in Py_BytesMain Modules/main.c:743
#11 0x630540 in main Programs/python.c:15
#12 0x339bf0 (/usr/lib/libc.so.6+0x29bf0)
#13 0x339e14 in __libc_start_main (/usr/lib/libc.so.6+0x29e14) |
I fail to reproduce the issue on Fedora 38 with GCC 13.1.1. I built the 3.12 branch of the Git repository and it works fine:
Oh. It seems like Thread-Local Variable is not well implemented on this old architecture. Python now has a |
sysconfig --generate-posix-vars
step
This looks to be a binutils bfd linker bug, see https://bugs.gentoo.org/909544#c12. Reported it over there at https://sourceware.org/bugzilla/show_bug.cgi?id=30697. Thanks. |
Great! |
Crash report
Python 3.12 fails when building itself while calling
./python -E -S -m sysconfig --generate-posix-var
. I first noticed this when building Gentoo's Python 3.12 package, but can reproduce with a git checkout of 3.12.0b3 using(export CFLAGS_NODIST="-O2" ; ./configure --enable-shared && make -j$(nproc) CPPFLAGS= CFLAGS= LDFLAGS= )
.The
--enable-shared
is required, as the crash doesn't seem to happen without it.Error messages
Enter any relevant error message caused by the crash, including a core dump if there is one.
When building with
--with-pydebug
, I get:With UBSAN, I get:
Your environment
The text was updated successfully, but these errors were encountered: