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

There seems to be an error in my email client. There is an i(plus)(plus).
----- Original Message ----
From: Marek.Marcola@malkom.pl
To: openssl-users@openssl.org
Date: Tue, 8 Apr 2008 12:50:07 0200
Subject: RE: CRYPTO_add_lock() segmentation fault (core dump included)=20

Hello,

> Oh
> I forgot to mention that I instantiated those variables (it was like=20

obvious for me).=20
> Here is the initialization code:
>=20
> int Server::TLS_init()
> {
> =C2=A0 =C2=A0 int i;
>=20
> =C2=A0 =C2=A0 mutex_buf =3D (pthread_mutex_t*) malloc(CRYPTO_num_locks() =

*=20
sizeof(pthread_mutex_t));
> =C2=A0 =C2=A0 if (mutex_buf =3D=3D NULL) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -1;
> =C2=A0 =C2=A0 }
> =C2=A0 =C2=A0 for (i =3D 0; i < CRYPTO_num_locks(); i ) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 pthread_mutex_init(&mutex_buf[i], NULL);
> =C2=A0 =C2=A0 }

Maybe changing "i" to "i " may help.

> =C2=A0 =C2=A0 CRYPTO_set_locking_callback(locking_function);
> =C2=A0 =C2=A0 CRYPTO_set_id_callback(id_function);
>=20
> =C2=A0 =C2=A0 SSL_library_init();
> =C2=A0 =C2=A0 SSL_load_error_strings();
>=20
> =C2=A0 =C2=A0 return 0;
> }
>=20
> int Server::TLS_cleanup()
> {
> =C2=A0 =C2=A0 int i;
>=20
> =C2=A0 =C2=A0 if (mutex_buf =3D=3D NULL) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;
> =C2=A0 =C2=A0 }
>=20
> =C2=A0 =C2=A0 CRYPTO_set_locking_callback(NULL);
> =C2=A0 =C2=A0 CRYPTO_set_id_callback(NULL);
>=20
> =C2=A0 =C2=A0 for (i =3D 0; i < CRYPTO_num_locks(); i ) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 pthread_mutex_destroy(&mutex_buf[i]);
> =C2=A0 =C2=A0 }

Maybe changing "i" to "i " may help.

> =C2=A0 =C2=A0 free(mutex_buf);
> =C2=A0 =C2=A0 mutex_buf =3D NULL;
>=20
> =C2=A0 =C2=A0 return 0;
> }


Best regards,
--
Marek Marcola=20

__________________________________________________ ____________________
OpenSSL Project =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 http://www.openssl.or=
g
User Support Mailing List =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0openssl-users@openssl.org
Automated List Manager =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 majordomo@openssl.org


-----------------------------------
Nirvana


__________________________________
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

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

There seems to be an error in my email client. There is an i(plus)(plu=
s).
----- Original Message ----
From: Marek.Marcola@malkom.pl
/>To: openssl-users@openssl.org
Date: Tue, 8 Apr 2008 12:50:07 0200 r />Subject: RE: CRYPTO_add_lock() segmentation fault (core dump included) =


Hello,

> Oh
> I forgot to mention that=
I instantiated those variables (it was like
obvious for me).
&=
gt; Here is the initialization code:
>
> int Server::TLS_i=
nit()
> {
>     int i;
>
> &nbsp=
;   mutex_buf =3D (pthread_mutex_t*) malloc(CRYPTO_num_locks() *

>sizeof(pthread_mutex_t));
>     if (mutex_buf =3D=3D NUL=
L) {
>         return -1;
>   &nbs=
p; }
>     for (i =3D 0; i < CRYPTO_num_locks(); i ) {=

>         pthread_mutex_init(&mutex_buf[i]=
, NULL);
>     }
Maybe changing "i" to &qu=
ot;i " may help.

>     CRYPTO_set_locking_cal=
lback(locking_function);
>     CRYPTO_set_id_callback(id_=
function);
>
>     SSL_library_init();
>=
    SSL_load_error_strings();
>
>    =
return 0;
> }
>
> int Server::TLS_cleanup()
=
> {
>     int i;
>
>     if=
(mutex_buf =3D=3D NULL) {
>         return 0;<=
br />>     }
>
>     CRYPTO_set_loc=
king_callback(NULL);
>     CRYPTO_set_id_callback(NULL);<=
br />>
>     for (i =3D 0; i < CRYPTO_num_locks();=
i ) {
>         pthread_mutex_destroy(&mut=
ex_buf[i]);
>     }
Maybe changing "i" to =
"i " may help.

>     free(mutex_buf); />>     mutex_buf =3D NULL;
>
>   &nbsp=
; return 0;
> }

Best regards,
--
Marek Marcola=


__________________________________________________ ___________=
_________
OpenSSL Project             &n=
bsp;                   =3D"http://www.openssl.org" target=3D"_blank">http://www.openssl.org />User Support Mailing List             &nbs=
p;      openssl-users@openssl.org
Automated List Manage=
r                     &nb=
sp;     majordomo@openssl.org

-----------------------=
------------
Nirvana


__________________________________<=
br>

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!

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