Skip to content
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

TestRandomPool asserts on VS2022 with a debug build #1103

Closed
dgm3333 opened this issue Jan 19, 2022 · 2 comments
Closed

TestRandomPool asserts on VS2022 with a debug build #1103

dgm3333 opened this issue Jan 19, 2022 · 2 comments

Comments

@dgm3333
Copy link

dgm3333 commented Jan 19, 2022

This is probably not a major issue given it only occurs on a debug test on a depreciated function but I can't see it's been reported elsewhere

Running Win10 64 pro
Crypto latest (unmodified direct from git) = Library version (library): 870, header version (app): 870
Visual Studio 2022 debug build after opening via cryptest.sln
NB the release build works fine

using local windows debugger to run cryptest

fails:-

pass=TestRandomPool() && pass;

at assert:-

// If this assert fires, then outString == inString. You could experience a
// performance hit. Also see https://github.com/weidai11/cryptopp/issues/1088'
CRYPTOPP_ASSERT(outString != inString);

with output:-

Testing OldRandomPool generator...

Assertion failed: C:\Users\usr\source\repos\cryptopp\strciphr.cpp(249): CryptoPP::CFB_CipherTemplate<class CryptoPP::AbstractPolicyHolder<class CryptoPP::CFB_CipherAbstractPolicy,class CryptoPP::CFB_ModePolicy> >::ProcessData

This is the callstack at the point of assert failure:-

>	KernelBase.dll!00007ff886af90d2()	Unknown
 	cryptest.exe!CryptoPP::CFB_CipherTemplate<CryptoPP::AbstractPolicyHolder<CryptoPP::CFB_CipherAbstractPolicy,CryptoPP::CFB_ModePolicy>>::ProcessData(unsigned char * outString, const unsigned char * inString, unsigned __int64 length) Line 249	C++
 	cryptest.exe!CryptoPP::StreamTransformation::ProcessString(unsigned char * inoutString, unsigned __int64 length) Line 1061	C++
 	cryptest.exe!CryptoPP::OldRandomPool::Stir() Line 138	C++
 	cryptest.exe!CryptoPP::OldRandomPool::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation & target, const std::string & channel, unsigned __int64 size) Line 151	C++
 	cryptest.exe!CryptoPP::RandomNumberStore::TransferTo2(CryptoPP::BufferedTransformation & target, unsigned __int64 & transferBytes, const std::string & channel, bool blocking) Line 1241	C++
 	cryptest.exe!CryptoPP::BufferedTransformation::TransferMessagesTo2(CryptoPP::BufferedTransformation & target, unsigned int & messageCount, const std::string & channel, bool blocking) Line 656	C++
 	cryptest.exe!CryptoPP::BufferedTransformation::TransferAllTo2(CryptoPP::BufferedTransformation & target, const std::string & channel, bool blocking) Line 702	C++
 	cryptest.exe!CryptoPP::SourceTemplate<CryptoPP::RandomNumberStore>::PumpAll2(bool blocking) Line 1444	C++
 	cryptest.exe!CryptoPP::Source::PumpAll() Line 1383	C++
 	cryptest.exe!CryptoPP::Source::SourceInitialize(bool pumpAll, const CryptoPP::NameValuePairs & parameters) Line 1421	C++
 	cryptest.exe!CryptoPP::RandomNumberSource::RandomNumberSource(CryptoPP::RandomNumberGenerator & rng, int length, bool pumpAll, CryptoPP::BufferedTransformation * attachment) Line 1520	C++
 	cryptest.exe!CryptoPP::Test::Test_RandomNumberGenerator(CryptoPP::RandomNumberGenerator & prng, bool drain) Line 449	C++
 	cryptest.exe!CryptoPP::Test::TestRandomPool() Line 666	C++
 	cryptest.exe!CryptoPP::Test::ValidateAll(bool thorough) Line 45	C++
 	cryptest.exe!CryptoPP::Test::Validate(int alg, bool thorough) Line 943	C++
 	cryptest.exe!CryptoPP::Test::scoped_main(int argc, char * * argv) Line 401	C++
 	cryptest.exe!main(int argc, char * * argv) Line 1095	C++
 	[External Code]	
@noloader noloader changed the title TestRandomPool fails on VS2022 with a debug build TestRandomPool asserts on VS2022 with a debug build Feb 10, 2022
@noloader
Copy link
Collaborator

We are testing the fix. I'm going to close this issue.

noloader added a commit that referenced this issue Feb 14, 2022
This commit attempts to restore performance while taming the optimizer.

Also see GH #683, GH #1010, GH #1088, GH #1103.
@noloader
Copy link
Collaborator

I merged the changes into master last night. You should test master now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants