#5 Do not unref LrErr_Exception on exit (RhBug:1778854)
Merged 4 years ago by amatej. Opened 4 years ago by lslebodn.
rpms/ lslebodn/librepo bz_1778854  into  master

file added
+27
@@ -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?= <lhrazky@redhat.com>

+ 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 {

file modified
+5 -1
@@ -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 @@ 

  %endif

  

  %changelog

+ * Wed Feb 05 2020 Lukas Slebodnik <lslebodn@fedoraproject.org> - 1.11.1-3

+ - Do not unref LrErr_Exception on exit (RhBug:1778854)

+ 

  * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

I used a scratch build for a while with hope it will be fixed in rawhide soon.
But it will be better to create PR than wait :-)

@pkratoch @jmracek @dmach
Could you please review/push/build package in rawhide?

Pull-Request has been merged by amatej

4 years ago
Metadata