[Help-gnutls] Re: Strange error in multi-threads
jas at extundo.com
Tue Oct 10 16:34:57 CEST 2006
Please use the list for discussion, so others can learn from it.
Unknown <prog1 at yobinario.com> writes:
> El mar, 10-10-2006 a las 14:53 +0200, Simon Josefsson escribió:
>> pthread_mutex_lock (&sessionlock);
>> gnutls_record_send (&session, buf, buflen);
>> pthread_mutex_unlock (&sessionlock);
>> You'll need to keep one mutex variable per session variable. And
>> check error codes etc...
>> Hm. Perhaps there should be an API to tell GnuTLS to call a
>> particular callback function before/after each use of a function that
>> modify the gnutls_session state.
> I only use functions that manage certificates. I do not use:
> the strange of this, is that in single program that call my function
> works without any problem, and in apache in single thread works. But in
> apache with normal mode(n threads) as module, segfault when DSO module
> run. At this time I can not debug the problem.
Oh, that's interesting. Can you provide a gdb backtrace?
Is your code threaded? If yes, does it also crash when you limit the
number of threads to one? (If this is possible..)
If your code isn't threaded, perhaps this is some general problem with
I'm assuming that you don't have any other global variables (like
credential variables) in your code that you use from multiple threads.
More information about the Gnutls-help