Stefan:

I wrote the comment.  The reason the code was excluded from Win2000
is because as the release was occuring someone reported a problem
on Win2000 and we could figure out why.  We never got additional 
information from the user.

I've read through the docs on DllMain() a bit more and it precludes
almost everything that is done within RAND_poll() because DllMain()
is not thread safe.  

It provides suggestions for how application specific initialization 
routines should be implemented so that functions such as RAND_poll() 
are not called from DllMain().   The suggestion is to use a semaphore
to check to see if the application specific initialization routine 
has been called and if not, to call the routine.

I suggest you make this change.  Otherwise, you need to remove 
not just the Performance Data query but also the Network calls
and perhaps the process, thread, and heap checks.  Otherwise, the
behavior will be unpredictable.  You remove all this and we don't
have a lot of entropy to play with.

- Jeff


> Hello Jeff,
> 
> I would say that the problem is the use of HKEY_PERFORMANCE_DATA in
> RAND_poll. 
> 
> The performance counter DLLs can contain any code and any application can
> install its own counters. RAND_poll() calls
> RegQueryValueEx(HKEY_PERFORMANCE_DATA, "Global", ...), which retrieves all
> (well, almost) performance data in the system. So there is no way to tell
> what will happen when RAND_poll() is called.
> 
> Also, the performance data collection is already removed for Windows 2000
> due to some exception at random times in ADVAPI32.DLL (according to comments
> in the source code).  There have been several reports on openssl-dev from
> people with RAND_poll problems on NT4 that probably would be solved if the
> code was removed from NT also. (mine sure would :-)
> 
> /Stefan
> 
> > -----Original Message-----
> > From: Jeffrey Altman [mailto:[EMAIL PROTECTED]]
> > Sent: den 20 februari 2002 18:25
> > To: [EMAIL PROTECTED]
> > Cc: '[EMAIL PROTECTED]'
> > Subject: RE: RAND_poll hangs on WINNT 4.0
> > 
> > 
> > Stefan:
> > 
> > This is helpful information.  So the problem is not the use of
> > HKEY_PERFORMANCE_DATA on NT4 but how applications are using calls to
> > RAND_poll().
> > 
> > - Jeff
> > 
> > 
> > > Hello,
> > > 
> > > I have seen this too on a few NT4 machines (SP5, SP6). 
> > > 
> > > I use OpenSSL in a DLL that is used by several different 
> > applications. I
> > > (implicitly) call RAND_poll in an init function for the 
> > library. The problem
> > > (at least for me) is that some performance counter DLL 
> > calls CoInitializeEx.
> > > This is bad in two ways in my case:
> > > 
> > > 1. One app calls my init and then OleInitialize which fails 
> > because COM is
> > > already initialized with another threading model. This 
> > causes the app to
> > > quit.
> > > 
> > > 2. Another app calls my init function from DLLMain. 
> > Microsofts documentation
> > > says that it is illegal to call CoInitialize from DLLMain. 
> > The result is a
> > > deadlock.
> > > 
> > > Removing the performance data query solved the problem.
> > > 
> > > There have been some other reports of this problems on the 
> > openssl-dev list,
> > > check the archives (search for HKEY_PERFORMANCE_DATA).
> > > 
> > > Stefan Lindberg
> > > 
> > > Front Capital Systems AB
> > > email: [EMAIL PROTECTED]
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: Jerry Napoli [mailto:[EMAIL PROTECTED]]
> > > > Sent: den 20 februari 2002 17:10
> > > > To: [EMAIL PROTECTED]
> > > > Subject: RAND_poll hangs on WINNT 4.0
> > > > 
> > > > 
> > > > 
> > > > 
> > > > We use a static initializer in our dynamic library to 
> > seed openssl's
> > > > PRNG.  We've noticed curious behavior on WINNT 4.0 where 
> > > > RAND_poll hangs
> > > > on the Windows registry function, RegQueryValueEx, when trying to
> > > > extract performance behavior.
> > > > 
> > > > There is a documented bug with the ANSI version of 
> > RegQueryValueEx (KB
> > > > Q226371) and they suggest
> > > > using the UNICODE version of it directly, yet it still 
> > hangs even with
> > > > that version. 
> > > > 
> > > > For the time being, we removed the section where it polls the
> > > > performance data entirely and that works.
> > > > 
> > > > 
> > > > Has anyone experienced this behavior?
> > > > 
> > > > For the record, we're using OpenSSL 0.9.6c.
> > > > 
> > > > Thanks,
> > > > Jerry Napoli
> > > > [EMAIL PROTECTED]
> > > > 
> > ______________________________________________________________________
> > > > OpenSSL Project                                 
> > http://www.openssl.org
> > > > User Support Mailing List                    
> > [EMAIL PROTECTED]
> > > > Automated List Manager                           
> > [EMAIL PROTECTED]
> > > > 
> > > 
> > ______________________________________________________________________
> > > OpenSSL Project                                 
> > http://www.openssl.org
> > > User Support Mailing List                    
> > [EMAIL PROTECTED]
> > > Automated List Manager                           
> > [EMAIL PROTECTED]
> > > 
> > 
> > 
> > 
> >  Jeffrey Altman * Sr.Software Designer      C-Kermit 8.0 
> > available now!!!
> >  The Kermit Project @ Columbia University   includes Telnet, 
> > FTP and HTTP
> >  http://www.kermit-project.org/             secured with 
> > Kerberos, SRP, and 
> >  [EMAIL PROTECTED]                OpenSSL. 
> > Interfaces with OpenSSH
> > ______________________________________________________________________
> > OpenSSL Project                                 http://www.openssl.org
> > User Support Mailing List                    [EMAIL PROTECTED]
> > Automated List Manager                           [EMAIL PROTECTED]
> > 
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
> 



 Jeffrey Altman * Sr.Software Designer      C-Kermit 8.0 available now!!!
 The Kermit Project @ Columbia University   includes Telnet, FTP and HTTP
 http://www.kermit-project.org/             secured with Kerberos, SRP, and 
 [EMAIL PROTECTED]                OpenSSL. Interfaces with OpenSSH
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to