Potentially useful, but ...
A problem we frequently hit is multiple instances of libraries in a single process - often due to applications dragging in shared library dependencies they aren't explicitly aware of.

For that reason, this is only "mostly safe"  if you can reference count somehow, otherwise the result (for us anyway) will probably be crashes at process exit.
Leaving cleanup to the OS avoids that issue. Just having the call there doesn't seem to be a problem in iteself, as long it doesn't get added to some default exit path later.

Peter



"Verdon Walker" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

03/12/2003 09:29 AM
Please respond to openssl-dev

       
        To:        <[EMAIL PROTECTED]>
        cc:        
        Subject:        Library cleanup functionality



Although OpenSSL has an initialization routine (SSL_library_init), it
does not have a corresponding cleanup routine (SSL_library_cleanup). It
does have a few cleanup routines (e.g. EVP_cleanup, OBJ_cleanup, etc.)
but no overall cleanup function.

This has been an issue for us when running OpenSSL on NetWare. Although
NetWare will clean up the resources when a process goes away, it does
complain about unfreed resources before doing so. It is not clear if
there is a proper way to clean up the library resources when you are
done with them.

For instance, you can clean up any entries in the error queue for a
thread by calling ERR_remove_state(). However, there is no way to
actually clean up and free the queue itself. We added a routine to do
that on NetWare, but there is some reluctance to accept it into the main
body of code because it would naturally be a very dangerous function if
called inappropriately.

What are people's thoughts on the matter?

Should OpenSSL formalize a mechanism for cleaning up global library
resources? Or is it sufficient to let the OS do that work?

Verdon Walker
(801) 861-2633
[EMAIL PROTECTED]
Novell, Inc., the leading provider of information solutions
http://www.novell.com

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to