Thank you for your reply!
I didn't find any refferences to CRYPTO_set_add_lock_callback() in openssl man 
pages nor the meaning
of this functions/callbacks.
I didn't understand what does CRYPTO_add_lock () do.
Can you provide some information on this functions and maybe some code examples.
Thanks in advance
Best regards,
Ion

----- Original Message ----
From: Geoff Thorpe 
To: openssl-users@openssl.org
Date: Tue, 08 Apr 2008 10:44:35 -0400
Subject: Re: CRYPTO_add_lock() segmentation fault (core dump included) 

On Tue, 2008-04-08 at 03:35 -0500, Ion Scerbatiuc wrote:
> Hello!
> I wrote a multithreaded server using OpenSSL v 0.9.7a (running on a RH
> Enterprise Linux 2.6.9-55.0.2.ELsmp).
> The problem is my server is crashing at random times (it could stay
> alive for 24 hours or can crash within 4 hours). Inspecting the cores
> file I found that it crashes in the same location every time
> 
>     #0  0x00ba503f in CRYPTO_add_lock () from /lib/libcrypto.so.4
> 
> I defined the two needed callbacks (according to crypto man page) like
> this:
> 
> struct CRYPTO_dynlock_value
> {
>     pthread_mutex_t mutex;
> };
> 
> static pthread_mutex_t *mutex_buf = NULL;
> 
> static void locking_function(int mode, int n, const char *file, int
> line)
> {
>     if (mode & CRYPTO_LOCK) {
>         pthread_mutex_lock(&mutex_buf[n]);
>     } else {
>         pthread_mutex_unlock(&mutex_buf[n]);
>     }
> }
> 
> static unsigned long id_function(void)
> {
>     return ((unsigned long) pthread_self());
> }

Did you call CRYPTO_set_add_lock_callback() as well? You probably want
to set that and use the callback to do pthread_mutex_init().

Cheers,
Geoff



______________________________________________________________________
OpenSSL Project                                  http://www.openssl.org
User Support Mailing List                   [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]



__________________________________
Whozin  - Are you in? 
We pay  you  to read your own e-mail! 
Primul webmail adevărat în  limba română !   

Reply via email to