--=_ecd66f90eb375e4eca320bbc22deec25
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Hello!
I wrote a multithreaded server using OpenSSL v 0.9.7a (running on a RH Ente=
rprise Linux
2.6.9-55.0.2.ELsmp).
The problem is my server is crashing at random times (it could stay alive f=
or 24 hours or can crash
within 4 hours). Inspecting the cores file I found that it crashes in the s=
ame location every time

=C2=A0=C2=A0=C2=A0 #0=C2=A0 0x00ba503f in CRYPTO_add_lock () from /lib/lib=
crypto.so.4

I defined the two needed callbacks (according to crypto man page) like this=
:

struct CRYPTO_dynlock_value
{
=C2=A0=C2=A0=C2=A0 pthread_mutex_t mutex;
};

static pthread_mutex_t *mutex_buf =3D NULL;

static void locking_function(int mode, int n, const char *file, int line)
{
=C2=A0=C2=A0=C2=A0 if (mode & CRYPTO_LOCK) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pthread_mutex_lock(&mutex_buf[n]=
);
=C2=A0=C2=A0=C2=A0 } else {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pthread_mutex_unlock(&mutex_buf[=
n]);
=C2=A0=C2=A0=C2=A0 }
}

static unsigned long id_function(void)
{
=C2=A0=C2=A0=C2=A0 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.
=2E...........................................
=2E...........................................
=2E...........................................
Reading symbols from /lib/libnss_dns.so.2...done.
Loaded symbols for /lib/libnss_dns.so.2
#0=C2=A0 0x00ba503f in CRYPTO_add_lock () from /lib/libcrypto.so.4
(gdb) bt
#0=C2=A0 0x00ba503f in CRYPTO_add_lock () from /lib/libcrypto.so.4
#1=C2=A0 0x00be368c in BIO_free () from /lib/libcrypto.so.4
#2=C2=A0 0x00c9d1f5 in SSL_free () from /lib/libssl.so.4
#3=C2=A0 0x0805b29f in wns::ServerPort::EndPort (this=3D0x8f5ad08) at serve=
rport.cpp:57
#4=C2=A0 0x0805de03 in wns::ServerPort::CloseSocket (this=3D0x8f5ad08) at s=
erverport.cpp:186
#5=C2=A0 0x0805d144 in wns::ServerPort::disconnect (this=3D0x8f5ad08) at se=
rverport.cpp:153
#6=C2=A0 0x0058a28c in ost::SocketService::run (this=3D0x8db48d0) at socket=
port.cpp:743
#7=C2=A0 0x00e7113d in ccxx_exec_handler (th=3D0x8db48d0) at thread.cpp:109=
7
#8=C2=A0 0x00a813cc in start_thread () from /lib/tls/libpthread.so.0
#9=C2=A0 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!=20





__________________________________
Whozin - Are you in?=20
We pay you to read your own e-mail!=20
Primul webmail adev=C4=83rat =C3=AEn limba rom=C3=A2n=C4=83 ! =20

--=_ecd66f90eb375e4eca320bbc22deec25
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="UTF-8"

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 c=
rashing at random times (it could stay alive for 24 hours or can crash with=
in 4 hours). Inspecting the cores file I found that it crashes in the same =
location every time

  &n=
bsp;
#0  0x00ba503f in CRYPTO=
_add_lock () from /lib/libcrypto.so.4


I defined the =
two needed callbacks (according to crypto man page) like this:

<=
font face=3D"courier" color=3D"#008000">struct CRYPTO_dynlock_value
{<=
br />    pthread_mutex_t mutex;
};

static pt=
hread_mutex_t *mutex_buf =3D NULL;

static void locking_function(=
int mode, int n, const char *file, int line)
{
   =
if (mode & CRYPTO_LOCK) {
      &nb=
sp; pthread_mutex_lock(&mutex_buf[n]);
    } else {=

        pthread_mutex_unlock(&=
mutex_buf[n]);
    }
}

static unsigned =
long id_function(void)
{
    return ((unsigned lon=
g) pthread_self());
}

=3D"#000000">The core dump (some lines where trimmed) looks something like =
this:

Core was generated by '/foo/bar -args'.
Program termi=
nated with signal 11, Segmentation fault.
............................=
.................
............................................
...=
..........................................
Reading symbols from /lib/li=
bnss_dns.so.2...done.
Loaded symbols for /lib/libnss_dns.so.2
#0&=
nbsp; 0x00ba503f in CRYPTO_add_lock () from /lib/libcrypto.so.4
(gdb) =
bt
#0  0x00ba503f in CRYPTO_add_lock () from /lib/libcrypto.so.4<=
br />#1  0x00be368c in BIO_free () from /lib/libcrypto.so.4
#2&nb=
sp; 0x00c9d1f5 in SSL_free () from /lib/libssl.so.4
#3  0x0805b29=
f in wns::ServerPort::EndPort (this=3D0x8f5ad08) at serverport.cpp:57
=
#4  0x0805de03 in wns::ServerPort::CloseSocket (this=3D0x8f5ad08) at s=
erverport.cpp:186
#5  0x0805d144 in wns::ServerPort::disconnect (=
this=3D0x8f5ad08) at serverport.cpp:153
#6  0x0058a28c in ost::So=
cketService::run (this=3D0x8db48d0) at socketport.cpp:743
#7  0x0=
0e7113d in ccxx_exec_handler (th=3D0x8db48d0) at thread.cpp:1097
#8&nb=
sp; 0x00a813cc in start_thread () from /lib/tls/libpthread.so.0
#9&nbs=
p; 0x003bac3e in clone () from /lib/tls/libc.so.6

What can be th=
e problem of this crashes? Should I update to 0.9.8g?
Please advice! r />Thanks!


<=
p>


__________________________________


Whozin=
- Are you in?

We pay you to read your own e-mail!

Primul webmail adev=C4=83rat =C3=AEn limba rom=C3=A2n=C4=83!

--=_ecd66f90eb375e4eca320bbc22deec25--
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majordomo@openssl.org