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());
}

The core dump (some lines where trimmed) looks something like this:

Core was generated by '/foo/bar -args'.
Program terminated with signal 11, Segmentation fault.
............................................
............................................
............................................
Reading symbols from /lib/libnss_dns.so.2...done.
Loaded symbols for /lib/libnss_dns.so.2
#0  0x00ba503f in CRYPTO_add_lock () from /lib/libcrypto.so.4
(gdb) bt
#0  0x00ba503f in CRYPTO_add_lock () from /lib/libcrypto.so.4
#1  0x00be368c in BIO_free () from /lib/libcrypto.so.4
#2  0x00c9d1f5 in SSL_free () from /lib/libssl.so.4
#3  0x0805b29f in wns::ServerPort::EndPort (this=0x8f5ad08) at serverport.cpp:57
#4  0x0805de03 in wns::ServerPort::CloseSocket (this=0x8f5ad08) at 
serverport.cpp:186
#5  0x0805d144 in wns::ServerPort::disconnect (this=0x8f5ad08) at 
serverport.cpp:153
#6  0x0058a28c in ost::SocketService::run (this=0x8db48d0) at socketport.cpp:743
#7  0x00e7113d in ccxx_exec_handler (th=0x8db48d0) at thread.cpp:1097
#8  0x00a813cc in start_thread () from /lib/tls/libpthread.so.0
#9  0x003bac3e in clone () from /lib/tls/libc.so.6

What can be the problem of this crashes? Should I update to 0.9.8g?
Please advice!
Thanks! 





__________________________________
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