Repository navigation
Closed
Labels
3.13only security fixes3.14bugs and security fixestype-crashA hard crash of the interpreter, possibly with a core dump
Description
Crash report
What happened?
After upgrading to CPython 3.13.0rc1, the gpgme test suite started failing. The tests fail with errors resembling:
Traceback (most recent call last):
File "/tmp/gpgme-1.23.2/lang/python/tests/./final.py", line 24, in <module>
import support
File "/tmp/gpgme-1.23.2/lang/python/tests/support.py", line 60, in <module>
assert_gpg_version((2, 1, 12))
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/tmp/gpgme-1.23.2/lang/python/tests/support.py", line 35, in assert_gpg_version
c.engine_info.version).group(0)
^^^^^^^^^^^^^
File "/tmp/gpgme-1.23.2/lang/python/python3.13-gpg/lib.linux-x86_64-cpython-313/gpg/core.py", line 1352, in engine_info
infos = [i for i in self.get_engine_info() if i.protocol == p]
~~~~~~~~~~~~~~~~~~~~^^
File "/tmp/gpgme-1.23.2/lang/python/python3.13-gpg/lib.linux-x86_64-cpython-313/gpg/core.py", line 1366, in get_engine_info
return gpgme.gpgme_ctx_get_engine_info(self.wrapped)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/tmp/gpgme-1.23.2/lang/python/python3.13-gpg/lib.linux-x86_64-cpython-313/gpg/gpgme.py", line 880, in gpgme_ctx_get_engine_info
return _gpgme.gpgme_ctx_get_engine_info(ctx)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
File "<frozen importlib._bootstrap>", line 649, in parent
SystemError: Objects/dictobject.c:3774: bad argument to internal function
FAIL: final.pyI've been able to bisect it to 233ed46 (#121869). However, on this commit I'm getting also a bunch of python3.13: Objects/typeobject.c:5257: _PyType_LookupRef: Assertion '!PyErr_Occurred()' failed. — they are fixed in some subsequent commit. But the final.py failure occurs from that commit to tip of 3.13 (fe65a8b).
Now, gpgme's build system is horrible. To reproduce, I've done the following:
- Built CPython with
--with-assertions. - Created
ln -s python python3.13symlink in the build directory. - Installed the gpgme C library 1.23.2 using the system package manager.
- Then:
wget https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.23.2.tar.bz2
tar -xf gpgme-1.23.2.tar.bz2
cd gpgme-1.23.2
export PATH=${CPYTHON_BUILD_DIRECTORY}:$PATH
./configure # will probably need some -dev packages
cd lang/python
make PYTHONS=python3.13 check
Note that in order to rebuild, you need to rm -rf python3.13-gpg.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.13.0rc1 (main, Aug 2 2024, 18:56:30) [GCC 14.2.0]
Linked PRs
Reacted by Edgar Ramírez Mondragón
Metadata
Metadata
Assignees
Labels
3.13only security fixes3.14bugs and security fixestype-crashA hard crash of the interpreter, possibly with a core dump
Activity
thesamesam commentedon Aug 6, 2024
cc @gaogaotiantian @ncoghlan
hroncok commentedon Aug 6, 2024
We see this in Fedora as well.
https://bugzilla.redhat.com/show_bug.cgi?id=2303107
gpgme built with Python 3.13.0b4 exhibits the same behavior when run on Python 3.13.0rc1.
hroncok commentedon Aug 6, 2024
Should not be necessary. We build Python without and the same SystemError happens.
vstinner commentedon Aug 6, 2024
The problem is that PyDict_Update() is called with NULL as the first argument. It's a regression in PyEval_GetLocals().
gdb traceback:
pythongh-122728: Fix typo in PyEval_GetLocals()
pythongh-122728: Fix SystemError in PyEval_GetLocals()
pythongh-122728: Fix SystemError in PyEval_GetLocals()
[-]3.13.0rc1 regression in `gpgme`: `SystemError: Objects/dictobject.c:3774: bad argument to internal function`[/-]gh-122728: Fix SystemError in PyEval_GetLocals() (#122735)
pythongh-122728: Fix SystemError in PyEval_GetLocals() (pythonGH-122735)
00434: pythongh-122728: Fix SystemError in PyEval_GetLocals()
[3.13] gh-122728: Fix SystemError in PyEval_GetLocals() (GH-122735) (#…
vstinner commentedon Aug 6, 2024
Fixed. Thanks @mgorny and @hroncok for the bug report.
pythongh-122728: Fix SystemError in PyEval_GetLocals() (python#122735)
pythongh-122728: Fix SystemError in PyEval_GetLocals() (python#122735)