I can´t say what is exactly causing your problem, but we had a very similar problem when stressing our OpenSSL applications with 100 threads. We did exactly the same that you: to use the callbacks you mention in mttest.c.
Our problem was not to use certain reentrant functions as books say (specially gethostbyname_r and other "inet" functions). This was causing very extrange behaviour, specially crashes in extrange places of our code. Also, the OpenSSL OBJ_XXX functions and all that OBJ management gave us problems, because we were dinamically adding some custom OIDs to the internal OpenSSL OID object list and you need a mutex to handle that list.
 
We discovered this in a couple of days building a little application to stress our code.This way, the problem is produced in minutes, not days.Once we carefully revised that functions, OpenSSL worked perfectly with the supplied callbacks.
----- Original Message -----
Sent: Wednesday, April 06, 2005 11:51 AM
Subject: OpenSSL Segmentation Fault

Dear Users

 

I have developed a custom OpenSSL based multi-threaded server. It only uses ADH and is working fine except for one problem. The server crashes randomly with segmentation fault. However, it does not generate any core dump. I am developing this server on RH9 with OpenSSL 0.9.7a. The fault occurs either during handshake or occasionally when a thread is finishing up. I have two possible reasons in mind. One is the “Security Advisory” issue 1 listed on main org page. Second is wrong implementation of callback functions. The first reason seems like a remote possibility but still may be causing this.

 

The callback functions that multi-threaded OpenSSL implementation requires are copied from mttest.c with one change. The “lock_count” variable seemed unnecessary as it was not present in implementations for other platforms and so it was removed. I am not sure if that may be causing this random crash. Please advise if “lock_count” variable is a must in POSIX based implementations. I am testing with this implemented now but still need confirmation as the crash is pretty random. Once it crashed after running for 3 days and handling 3000 requests.

 

Apart from these two reasons, if anyone has any other idea about what may be causing this crash, please let me know. This server is waiting release due to this bug. Any help will be highly appreciated.

 

Dr. Henson you are quite expert on OpenSSL. Your help has been quite useful in the past. Please suggest some course of action.

 

Regards,

Nauman Akbar

Concise Solutions

Pakistan

Reply via email to