-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in RandomNumberGenerator::GenerateWord32 due to stack recursion #38
Comments
Am 06.10.2015 um 21:49 schrieb Jeffrey Walton:
I'm not sure though if this already counts as "breaking compatibility" BTW: If we "fix" this we may have to do the exact same (put the caller BR JPM
|
How does the following look to you? Any objections?
We could not make the base class a pure virtual, or make many/most functions pure virtual. Too many things broke in derived classes. We might be able to make We could not apply this to Derived classes must override |
Am 08.10.2015 um 01:28 schrieb Jeffrey Walton:
So no objections :) BR JPM
|
Yeah, this is one of those areas where I think we want to document and lead by example. We discuss creating a generator on the wiki at RandomNumberGenerator | Creating A Generator. We also provide a sample generator on the wiki at Mersenne Twister.
OK, good. I'm going to close it. |
The AutoSeeded generators override I don't want to modify about half the generators just to enforce design criteria. I think its a bit much, even if it may be a good idea. If the group wants it, then we can do it. We added self tests to |
So this is interesting... Based on Uri's suggestion, we added a self test for
The offending statement was:
For completeness, here's what it was changed to:
|
Testing of
RandomNumberGenerator::GenerateWord32
revealed a potential bug inGenerateBlock
.GenerateBlock
callsGenerateIntoBufferedTransformation
.GenerateIntoBufferedTransformation
, in turn, calls,GenerateBlock
. Ad infinitum.In the past, a patch to call
OS_GenerateRandom
was declined; see Patch for RandomNumberGenerator::GenerateIntoBufferedTransformation bug. It turns out that was not a bad decision. But the issue endured and we got a private bug report against 5.6.3rc4 due to it.I dug up an old email thread with Wei on the same subject (from 2012 or so), and here's what he had to say about it:
So I'd like to make it so it can't be instantiated. The best way I know is to remove the implementations for
GenerateIntoBufferedTransformation
andGenerateBlock
, and make them pure virtuals.The text was updated successfully, but these errors were encountered: