From 7193ef616acbabf901ef80d28fe24f58c1a43746 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Wed, 5 Feb 2020 13:31:19 +0100 Subject: [PATCH] Do not unref LrErr_Exception on exit (RhBug:1778854) --- 180.patch | 27 +++++++++++++++++++++++++++ librepo.spec | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 180.patch diff --git a/180.patch b/180.patch new file mode 100644 index 0000000..0fe2c82 --- /dev/null +++ b/180.patch @@ -0,0 +1,27 @@ +From c7d2f38c06039798f998c7c83685b1b44ffd24d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hr=C3=A1zk=C3=BD?= +Date: Thu, 16 Jan 2020 17:32:29 +0100 +Subject: [PATCH] Do not unref LrErr_Exception on exit (RhBug:1778854) + +It seems the reference to a Python exception obtained from +PyErr_NewException is borrowed and is not meant to be decref'd on +exit. From valgrind output Python frees the memory allocated for these +itself. + +https://bugzilla.redhat.com/show_bug.cgi?id=1778854 +--- + librepo/python/librepomodule.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/librepo/python/librepomodule.c b/librepo/python/librepomodule.c +index 231a8cf..3d52893 100644 +--- a/librepo/python/librepomodule.c ++++ b/librepo/python/librepomodule.c +@@ -134,7 +134,6 @@ exit_librepo(void) + { + Py_XDECREF(debug_cb); + Py_XDECREF(debug_cb_data); +- Py_XDECREF(LrErr_Exception); + } + + struct module_state { diff --git a/librepo.spec b/librepo.spec index 5a9ec7d..e47548b 100644 --- a/librepo.spec +++ b/librepo.spec @@ -27,12 +27,13 @@ Name: librepo Version: 1.11.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Repodata downloading library License: LGPLv2+ URL: https://github.com/rpm-software-management/librepo Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +Patch01: 180.patch BuildRequires: cmake BuildRequires: gcc @@ -189,6 +190,9 @@ popd %endif %changelog +* Wed Feb 05 2020 Lukas Slebodnik - 1.11.1-3 +- Do not unref LrErr_Exception on exit (RhBug:1778854) + * Wed Jan 29 2020 Fedora Release Engineering - 1.11.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild