When data pipe is used for keyboxd (modifying the call kbx_client_data_new with no D-lines), it may cause a deadlock on the lock for estream.
In gpg-error, estream.c:do_deinit is registered by atexit. It is called when exit is called, and it calls _gpgrt_fflush for all streams.
But in kbx/kbx-client-util.c:datastream_thread, it calls es_read on the stream, so, that stream is locked when it blocks on read system call.
Thus, it cannot finish the process.
gpg_keyboxd_deinit_session_data should be called before calling exit, so that the call of assuan_release can close the assuan connection (and thus, pipe connection, too). Then, read system call will return an error with EPIPE, to finish the datastream thread.