Bug 1934744

Summary: Deadlock when handling indications
Product: [Fedora] Fedora Reporter: Spike <SpikeFedora>
Component: python-gattlibAssignee: Gwyn Ciesla <gwync>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: gwync
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-gattlib-0.20201113-4.fc33 python-gattlib-0.20201113-4.fc34 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-11 23:37:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Spike 2021-03-03 18:55:16 UTC
Description of problem:
Waiting for an "on indication" event can lead to a dealock

Version-Release number of selected component (if applicable):
python3-gattlib-0.20201113-1.fc33.x86_64

How reproducible:
Always (but might depend on hardware)

Steps to Reproduce:
Minimal, complete, viable example (might be dependent on hardware):

import time
from gattlib import GATTRequester
req = GATTRequester("00:11:22:33:44:55")
req.write_by_handle(0x001f, bytes([0x02, 0x00]))
time.sleep(1)
req.write_by_handle(0x001e, bytes([0xc0, 0x55, 0x02, 0x01, 0x00, 0x1a]))
time.sleep(1)
req.write_by_handle(0x001e, bytes([0xc0, 0x56, 0x01, 0x00, 0x1e]))
time.sleep(1)
req.write_by_handle(0x001e, bytes([0xc0, 0x56, 0x01, 0x00, 0x1e]))
time.sleep(1)

Actual results:
on indication, handle: 0x1e -> 00:00:10:02:08:ffffffec:05:00:00:00:00:00:00:00:00:00:00:00:00:ffffffa4:


Expected results:
on indication, handle: 0x1e -> 00:00:10:02:08:ffffffeb:05:00:00:00:00:00:00:00:00:00:00:00:00:06:
on indication, handle: 0x1e -> 00:00:00:ffffff82:
on indication, handle: 0x1e -> 00:ffffffc0:55:10:02:09:ffffffeb:05:00:00:00:00:00:00:00:00:00:00:00:00:2c:
on indication, handle: 0x1e -> 00:00:00:ffffff82:
on indication, handle: 0x1e -> 00:ffffffc0:55:10:06:08:ffffffec:05:47:72:41:3f:00:00:00:00:00:00:00:00:1c:

Additional info:
Fix is already upstream: https://github.com/oscaracena/pygattlib/commit/018d852f860c415bf68897820570432ba9b0ba04
Please include this in the package or ask upstream about a bugfix release.

Comment 1 Fedora Update System 2021-03-03 21:57:20 UTC
FEDORA-2021-1484b0c872 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-1484b0c872

Comment 2 Fedora Update System 2021-03-04 16:57:33 UTC
FEDORA-2021-d32f7e0440 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-d32f7e0440`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-d32f7e0440

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 3 Fedora Update System 2021-03-04 20:42:26 UTC
FEDORA-2021-1484b0c872 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-1484b0c872`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-1484b0c872

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2021-03-11 23:37:38 UTC
FEDORA-2021-1484b0c872 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Fedora Update System 2021-03-19 20:01:44 UTC
FEDORA-2021-d32f7e0440 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.