Bill Rebey <[EMAIL PROTECTED]>:

> On a SPARC running Solaris 2.7, my application crashed with a bus error.
> 
> Here is the stack trace form the core:
> 
> [1] lh_retrieve(0x63150, 0x522c7, 0xf4624, 0x61737465, 0xcbb0588c, 0xf8220),
> at 0x61be0
> [2] ERR_get_state(0xdf000, 0xc5cf8, 0x6523, 0x0, 0xef5d5250, 0x3466), at
> 0x63340
> [3] get_error_values(0x1, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x62b68
[...]
> Significant notes:
> 
> This code didn't cause a problem until about the 8,000th  call to it (as you
> can see the code is in a destructor for a Thread class that I wrote;  about
> 8,000 threads were successfully started and stopped before this one
> crashed).
> 
> The SSL library was never initialized.  Why??  Because in my little world,
> sockets know about SSL things; threads do not. SSL has nothing to with
> threads, as threads can be used for anything.  [...]

If you use OpenSSL with multi-threading, you *have* to provide
locking callback functions for synchronizing access to global
(and shared) data structures.
See <URL: http://www.openssl.org/docs/crypto/thread.html>.

Also you should call ERR_remove_state(0) in each thread that is about
to be terminated, but failure to do so should only result in memory
leaks and not in a crash.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to