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: