Page MenuHome GnuPG

Deadlock on Windows in sdaemon
Open, HighPublic

Description

At least on Windows and thus with pc/sc we have a reliabale lockup with smartcards. Tested with a PIV card and a single reader. Reproducer is.

  • Start Kleopatra
  • Remove card
  • Insert card
  • Sign something e.g. using the clipboard.

Here gpgsm calls scd and in turn touches the reader_status file. Kleopatra wakes up due to the touched reader status and block in scd's get_card function. Trying to do a reset with gpg-connect-agent also blocks in get_card

Hypothesis: Somewhere the unlock (put_card) does not work or the card_list and the card lock deadlock.

Here is a commented log using code with some additional debug output:

Details

Version
gpg4win 4.3.1

Event Timeline

werner created this task.

There are two locks here; (1) rw_lock for card_top (list of cards) access and (2) individual card lock.
It looks for me that:

  • don't know how/what the thread 7208.2 does
  • the thread 7208.3: KEYINFO, then PKSIGN (gets read lock for card_top, then, individual card lock)
  • the thread 7208.4: SERIALNO --all (and wait for write lock for card_top)

If there is longer log, please show me the log about the thread 7208.2.

The reset was due to running gpg-connect-agent reset /bye. I am currently testing something elese will get back as soon as I can turn back to 2.4