gpgme hangs in a multithreaded app

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


--6TrnltStXW4iwmi0
Content-Type: text/plain; format=flowed; charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Marcus!

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

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

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

Anyway, thanks for your help!

Cheers, Albrecht.

P.S.: Viele Gr=FC=DFe 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.
>=20
> _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:
>=20
> 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.
>=20
> 2. The read is actually hanging.  This would mean that there is some
> issue
> in glibc that causes this.
>=20
> 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.
>=20
> Thanks,
> Marcus

--=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Albrecht Dre=DF  -  Johanna-Kirchner-Stra=DFe 13  -  D-53123 Bonn (German=
y)
        Phone (+49) 228 6199571  -  mailto:albrecht.dress@arcor.de
_________________________________________________________________________
--6TrnltStXW4iwmi0
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+g0hdn/9unNAn/9ERAqmvAJoCa2zya+zWje8xBr1vqN4+bRKLcgCfY/fv
8BKaMVIsiE3GGcijOKusD30=
=fgKe
-----END PGP SIGNATURE-----

--6TrnltStXW4iwmi0--