From a1720439d205ef6cf379d986aa110e256febd8dc Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Mar 03 2021 21:46:43 +0000 Subject: Patch for deadlocks. --- diff --git a/018d852f860c415bf68897820570432ba9b0ba04.patch b/018d852f860c415bf68897820570432ba9b0ba04.patch new file mode 100644 index 0000000..c33d624 --- /dev/null +++ b/018d852f860c415bf68897820570432ba9b0ba04.patch @@ -0,0 +1,26 @@ +From 018d852f860c415bf68897820570432ba9b0ba04 Mon Sep 17 00:00:00 2001 +From: John Sullivan +Date: Mon, 23 Nov 2020 11:03:05 +0000 +Subject: [PATCH] avoid deadlock when handling notifications/indications + +--- + src/bluez/attrib/gattrib.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/bluez/attrib/gattrib.c b/src/bluez/attrib/gattrib.c +index ac5fc4b..593ddd0 100644 +--- a/src/bluez/attrib/gattrib.c ++++ b/src/bluez/attrib/gattrib.c +@@ -475,8 +475,11 @@ static gboolean received_data(GIOChannel *io, GIOCondition cond, gpointer data) + for (l = attrib->events; l; l = l->next) { + struct event *evt = l->data; + +- if (match_event(evt, buf, len)) ++ if (match_event(evt, buf, len)) { ++ AUNLOCK(attrib); + evt->func(buf, len, evt->user_data); ++ ALOCK(attrib); ++ } + } + + if (!is_response(buf[0])) { diff --git a/python-gattlib.spec b/python-gattlib.spec index 3d113d5..4397e21 100644 --- a/python-gattlib.spec +++ b/python-gattlib.spec @@ -11,6 +11,7 @@ License: ASL 2.0 and GPLv2+ and LGPLv2+ URL: https://github.com/oscaracena/pygattlib Source0: https://files.pythonhosted.org/packages/source/g/%{modname}/%{modname}-%{version}.tar.gz Source1: COPYING +Patch0: 018d852f860c415bf68897820570432ba9b0ba04.patch BuildRequires: gcc-c++ @@ -32,7 +33,7 @@ BuildRequires: bluez-libs-devel Python %{python3_version} version. %prep -%autosetup -n %{modname}-%{version} +%autosetup -n %{modname}-%{version} -p1 cp %{S:1} . find . -type f | xargs chmod -x @@ -52,6 +53,9 @@ find . -type f | xargs chmod -x %{python3_sitearch}/%{modname}*.egg-info/ %changelog +* Wed Mar 03 2021 Gwyn Ciesla - 0.20201113-4 +- Patch for deadlock issue. + * Wed Jan 27 2021 Fedora Release Engineering - 0.20201113-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild