Uncaught exception when link breaks during connect().

Bug #710581 reported by Alexander Knaub
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nfcpy
Fix Released
Medium
Unassigned

Bug Description

In the phase when the LLCP client waits for CC or DM PDU, broken link causes closing of sockets. This leads to notifying receiver thread in class TransmissionControllObject that tries thereafter to pop data from empty receiving queue:

  File "./dbus_readerwriter.py", line 1015, in _connect
    nfc.llcp.connect(socket, service_name)
  File ".../nfcpy/nfc/llcp/__init__.py", line 114, in connect
    return _llc.connect(sid, dest)
  File ".../nfcpy/nfc/llcp/llc.py", line 478, in connect
    socket.connect(dest)
  File ".../nfcpy/nfc/llcp/tco.py", line 421, in connect
    pdu = super(DataLinkConnection, self).recv()
  File ".../nfcpy/nfc/llcp/tco.py", line 122, in recv
    return self.recv_queue.popleft()
IndexError: pop from an empty deque

Related branches

Revision history for this message
Alexander Knaub (sanyok-og) wrote :

As a workaround you can use something like following code:

try:
    nfc.llcp.connect(socket, service_name)
except IndexError:
    # regard this case as if connection has been refused

Changed in nfcpy:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Stephen Tiedemann (stephen-tiedemann) wrote :

This was fixed long time ago but forgotten about the bug report.

Changed in nfcpy:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.