I'm trying to use openssl-0.9.7a-23 (the RPM from Fedora 1)
in a multithreaded environment.

Basically I have a server with about 5 worker threads and 
a client with a varying number of threads that connect to
the server.

When using around 20 threads at the client I can't see any 
problems.

But when the client increases to around 150 threads the client
segfaults.

The server never segfaults.

The gdb trace is:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1431196752 (LWP 15771)]
0x00620b84 in _int_malloc () from /lib/tls/libc.so.6
(gdb) where
#0  0x00620b84 in _int_malloc () from /lib/tls/libc.so.6
#1  0x0062170a in _int_realloc () from /lib/tls/libc.so.6
#2  0x0062012f in realloc () from /lib/tls/libc.so.6
#3  0x00b70307 in OpenSSLDie () from /lib/libcrypto.so.4
#4  0x00b70a06 in CRYPTO_realloc () from /lib/libcrypto.so.4
#5  0x00bb84f4 in lh_doall_arg () from /lib/libcrypto.so.4
#6  0x00bb8248 in lh_insert () from /lib/libcrypto.so.4
#7  0x00000001 in ?? ()
#8  0x00c17210 in CAST_S_table7 () from /lib/libcrypto.so.4
#9  0x000001c4 in ?? ()
(

Within main I do the calls to:

  CRYPTO_set_id_callback((unsigned long (*)())pthreads_thread_id);
  CRYPTO_set_locking_callback((void (*)())pthreads_locking_callback);

One thing I'm not sure from the documentation is whether or not
the ctx can be shared across multiple threads. At this point I
am using a pointer to the same ctx everywhere and call the SSL_new
each time a connection needs encrypting.

Any ideas as to where I need to be looking to figure this out?

Thanks,

Alberto


-- 
Alberto Alonso                        Global Gate Systems LLC.
(512) 260-2523                        http://www.ggsys.net
Hardware, consulting, collocation, monitoring and remote backups
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to