AutoSeededRandomPool thread bug and WORKAROUND_MS_BUG_Q258000

168 views
Skip to first unread message

RnySmile

unread,
Feb 1, 2007, 11:12:46 AM2/1/07
to Crypto++ Users
Hi,

I found AutoSeededRandomPool have thread problems. e.g. when 10 thread
are running the function below, it throw exceptions.

void thread(void)
{
CryptoPP::AutoSeededRandomPool rng;
}

By reading this post:

http://groups.google.com/group/cryptopp-users/browse_thread/thread/f3001108e50435ed/892a114268233265?lnk=gst&q=AutoSeededRandomPool&rnum=1#892a114268233265

I removing the #define WORKAROUND_MS_BUG_Q258000 in the config.h and
run the test again, it runs without any problem.

So I suggest remove the deine in the official version.

RnySmile

Wei Dai

unread,
Feb 3, 2007, 8:29:12 AM2/3/07
to Crypto++ Users
Thanks for reminding me about this. I don't want to just remove this
workaround since there may be old systems out there still affected by this
bug. However I have checked in a fix to this threading bug, which I've also
copied here:

diff -r1.6 osrng.cpp
88c88
< static MicrosoftCryptoProvider m_Provider;
---
> const MicrosoftCryptoProvider &m_Provider =
> Singleton<MicrosoftCryptoProvider>().Ref();

Reply all
Reply to author
Forward
0 new messages