I've got a win32 exe that occasionally (~2% of the time) hangs during initialization of the process' usage of openssl. I've seen this for a long time (and through several versions), so I'm assuming it's something I'm doing. I'm currently working against openssl-0.9.8j. Anyway, code of interest looks basically like this:
int main(){ [initialize windows sockets] [initialize a bunch of (presumably)non-relevant application stuff] SSL_library_init(); ERR_load_crypto_strings(); ERR_load_SSL_strings(); ssl_ctx_client = SSL_CTX_new( TLSv1_client_method() ); // <-- hangs here sometimes .... } Call stack shows: _unlock(int locknum=0x00000001) Line 376 C _heap_alloc_dbg_impl(unsigned int nSize=0x00000000, int nBlockUse=0x00000000, const char * szFileName=0x001bf5c0, int nLine=0x00cfccbd, int * errno_tmp=0x5ffdb94f) Line 500 + 0x7 bytes C++ _nh_malloc_dbg_impl(unsigned int nSize=0x0000000c, int nhFlag=0x00000000, int nBlockUse=0x00000001, const char * szFileName=0x00000000, int nLine=0x00000000, int * errno_tmp=0x001bf3f0) Line 239 + 0x19 bytes C++ _nh_malloc_dbg(unsigned int nSize=0x001bf5c0, int nhFlag=0x00f004d0, int nBlockUse=0x001bf478, const char * szFileName=0x5ee8e30b, int nLine=0x005a7f90) Line 296 + 0x1d bytes C++ malloc(unsigned int nSize=0x0000000c) Line 56 + 0x15 bytes C++ _RAND_SSLeay() + 0x5d5 bytes C _RAND_bytes() + 0x34 bytes C _RAND_SSLeay() + 0xa8a bytes C _RAND_pseudo_bytes() + 0x34 bytes C _SSL_CTX_new() + 0x416 bytes C Clearly hung up in the heap... since it's hung in the heap, one point of interest is this is a statically linked library, compiled using ms\nt.mak using Microsoft's compiler from VS2008... used to have to edit nt.mak to use /MT and /MTd for release and debug, respectively, but since 98h that change exists in mak already. Compiles fine, links fine with no warnings etc. Has anybody seen this or have any ideas before I *really* dig? Thanks, Mark. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org