Thread safety problem (?)
vincent.deffontaines at inl.fr
Mon Apr 18 17:51:03 CEST 2005
I use gcrypt in a multithreaded server app (namely, nufw ) (also uses
glib and gnutls).
We experiment an occasionnal (hard to reproduce) crash which seems to
always occur at the gnutls call : gnutls_handshake(). The crash is quite
rare (and occurs in an often called loop), which leads us to believe
this might be a thread safety problem.
Gnutls people pointed us (on this thread ) to the gcrypt, and told us
we should use some locking mechanisms. Also, the "Multi-threaded
applications"  webpage seems to be of interest.
Our server runs this :
static struct gcry_thread_cbs gcry_threads_gthread =
and this :
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_gthread);
which doesn't seem to be enough to solve our problem.
As usual, the thread safety problems are very delicate, and we of course
cannot be sure this is gcrypt's "fault" or ours, or whatever.
If anyone on this list has more ideas about what to check/add, we will
be very interested to hear about it.
Any help/pointer will be appreciated.
Thanks for reading me,
More information about the Gcrypt-devel