gpgme hangs in a multithreaded app

Marcus Brinkmann Marcus.Brinkmann at
Thu Mar 27 14:14:01 CET 2003

On Thu, Mar 27, 2003 at 11:16:19AM +0100, albrecht.dress at wrote:
> I hacked RFC3156 support for the GNOME mail client balsa a few days ago, of course using gpgme (see Balsa is a multithreaded app, and it works perfectly with Linux on a PowerMac. However, when running on an upgraded SuSE 7.2/ix86, balsa hangs in gpgme.

gpgme in multithreaded applications is new area.  I am happy you tried this
out.  There are many pitfalls in GPGME which made it a bit difficult to get
it thread safe, but the ground work is done.  Luckily, the problem you are
actually experiencing does not seem to be related to some of the more
complex aspects in GPGME.

_gpgme_get_program_version is a simple function, basically calling fork (),
exec () to run gpg --version through a pipe and reading from the pipe to
determine the version number.  That the read() hangs can mean one of two

1. There is no data written to the pipe.  That would mean gpg doesn't
actually run, and you should follow the child to see what's going wrong.
A simple check would be to see if gpg --version does run (and if, if it is
hanging or not).  This might be difficult because of the timing.  But you
could replace /usr/bin/gpg with a wrapper to get more info.

2. The read is actually hanging.  This would mean that there is some issue
in glibc that causes this.

You could also try writing a small test case that I can add to the source. 
It would make it easy for me to take a closer look at this.


`Rhubarb is no Egyptian god.' GNU    marcus at
Marcus Brinkmann              The Hurd
Marcus.Brinkmann at

More information about the Gnupg-devel mailing list