diff --git a/fix-py3.12-segfault-at-exit.patch b/fix-py3.12-segfault-at-exit.patch new file mode 100644 index 0000000..9fceb00 --- /dev/null +++ b/fix-py3.12-segfault-at-exit.patch @@ -0,0 +1,31 @@ + +# HG changeset patch +# User Phil Thompson +# Date 1686925181 -3600 +# Node ID 312476401030130daed2eecfd1c93413f49e4458 +# Parent 88452293f4e4cdc9d22cb5dfca02ba83216f662b +sipMalloc() and sipFree() are now implemented using PyMem_RawMalloc() and +PyMem_RawFree() so that they should be safe to call from functions registered +with Py_AtExit(). + +diff -r 88452293f4e4 -r 312476401030 sipbuild/module/source/12/siplib.c +--- a/siplib.c Thu Jun 08 14:30:02 2023 +0100 ++++ b/siplib.c Fri Jun 16 15:19:41 2023 +0100 +@@ -2147,7 +2147,7 @@ + { + void *mem; + +- if ((mem = PyMem_Malloc(nbytes)) == NULL) ++ if ((mem = PyMem_RawMalloc(nbytes)) == NULL) + PyErr_NoMemory(); + + return mem; +@@ -2159,7 +2159,7 @@ + */ + void sip_api_free(void *mem) + { +- PyMem_Free(mem); ++ PyMem_RawFree(mem); + } + + diff --git a/python-pyqt5-sip.spec b/python-pyqt5-sip.spec index 38e0341..2cf1513 100644 --- a/python-pyqt5-sip.spec +++ b/python-pyqt5-sip.spec @@ -6,12 +6,13 @@ Name: python-%{pkg_name} Version: 12.12.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The sip module support for PyQt5 License: GPLv2 or GPLv3 URL: https://www.riverbankcomputing.com/software/sip/ Source0: %{pypi_source} +Patch0: fix-py3.12-segfault-at-exit.patch BuildRequires: gcc BuildRequires: python3-devel @@ -51,6 +52,9 @@ Provides: python3-pyqt5-sip-api(%{_sip_api_major})%{?_isa} = %{_sip_api} %{python3_sitearch}/PyQt5/ %changelog +* Fri Jun 16 2023 Scott Talbert - 12.12.1-3 +- Fix segfault at exit with Python 3.12 + * Tue Jun 13 2023 Python Maint - 12.12.1-2 - Rebuilt for Python 3.12