gpgme hangs in a multithreaded app

Albrecht Dreß albrecht.dress at arcor.de
Thu Mar 27 19:56:01 CET 2003


Hi Marcus!

Well, beleive it or, but changing the linking order removes the hang (I 
prefer *not* to say that it's resolved...), and the rest of gpg enabled 
balsa (including the more complicated stuff like signing, encrypting, ...) 
works peferctly, too. The "successful" command was

gcc -o balsa [objects + local libs] -lpthread -lc -L/usr/local/lib -lgpgme 
[rest of the libs...]

So I think you are right that this is a problem in either libc/libpthread 
or in the gnome libs. Obviously extremely difficult to tack it down. If I 
find some time (not soon, though...), I'll try to write a minimum program 
to reproduce it. Hmmmm...

Anyway, thanks for your help!

Cheers, Albrecht.

P.S.: Viele Grüße nach Bochum; ich hab' da E-Technik studiert...


Am 27.03.03 14:14 schrieb(en) Marcus Brinkmann:
> 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
> things:
> 
> 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.
> 
> Thanks,
> Marcus

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Albrecht Dreß  -  Johanna-Kirchner-Straße 13  -  D-53123 Bonn (Germany)
        Phone (+49) 228 6199571  -  mailto:albrecht.dress at arcor.de
_________________________________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /pipermail/attachments/20030327/2382ee18/attachment.bin


More information about the Gnupg-devel mailing list