Hypothetical scenario (gpgsm --server + dirmngr):
(0) It may hang when much debug messages are generated by libassuan to the pipe of (diag_cb).
(1) In gpgme, by engine-gpgsm, gpgsm is invoked with .
(2) If it's the case of standard gpgme interactions which uses gpgsm_io_event, no problem. Because the data on diag_cb is consumed well.
(3) In case of (or other commands), it uses which does not consume the data on diag_cb pipe at all.
(4) In particular, in , is called by the number of recipients times.
(5) IIUC, in the server side, to handle RECIPIENT command, dirmngr is used by the call chain of:
(6) In function, libassuan is used as client side, it generates debug messages.
(7) When there are many recipients, the debug message may be big enough to fill the pipe.
(8) When pipe is filled, it blocks at in , waiting the data in pipe is consumed.
(9) ... it hangs.