To reproduce, use gpgsm in a terminal to sign data piped into gpgsm's
stdin. The DISPLAY environment variable is not set, so that a
pinentry-gtk or pinentry-qt will fall back to curses mode.
E.g. start the agent and then sign data with
echo foo | gpgsm -sa -u UID
gpgsm starts to print the signed message:
-----BEGIN SIGNED MESSAGE-----
MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAaCA
[...]
But after a while it hangs. No pinentry dialog appears in the
terminal or elsewhere. ps or top reveal that pinentry is running with
almost 100% CPU and has to be killed.
It doesn't matter which pinentry the agent is configured is configured
to use. The problem appears with the same symptoms for pinentry-gtk,
pinentry-qt and pinentry-curses.
Also, signing a file whose name is given on the command line works
just fine.
Versions:
gpgsm (GnuPG) 2.0.4
gpg-agent (GnuPG) 2.0.4
pinentry-curses (pinentry) 0.7.2