If application is started as (win32_own_process) service on WinNT Server 4.0 SP 6 it may hang indefinitely in RAND_poll() during system startup. Problem occurs with OpenSSL releases between 0.9.6 and 0.9.6-c inclusively. Unfortunately, I dont have much time to trace the problem to its roots, but here is what helps to resolve it:
1. In RAND_poll() do not load (or use in any other way) netapi32.dll (change rand_win.c:216 to "netapi = 0;"). If left unchanged, it seems to cause some sort of deadlock in NDIS layer, preventing both openssl application and default system init sequence from proceeding. Once openssl application is killed, system instantly proceeds with initialization, launching whole bunch of network-related services (DHCP, DNS, IIS, etc). 2. In RAND_poll() disable code that queries (HKEY_PERFORMANCE_DATA, "Global") registry entry (change rand_win.c:257 to "if (0)"). If enabled, this code leads to yet another hang. Here is a description of similar problem from comp.os.ms-windows.programmer.win32 news group: http://groups.google.com/groups?q=RegQueryValueEx+HKEY_PERFORMANCE_DATA&star t=20&hl=en&group=comp.os.ms-windows.programmer.win32&selm=6l1lv2%241mv%40new sstand.cit.cornell.edu&rnum=21 Tracing the flow with printf() shows that (273-283) 'while' loop gets executed 5 times prior to hanging in 6th ReqQueryValueEx() call. Buffer size at the moment of call is 49152. Also, the same loop incorrectly interprets return of realloc(), assuming that if it returns 0 then passed block gets automatically free()'d. This will leak memory, if realloc() fails to do its job on non-empty block. Regards, alex. ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]