program stopping working without error when creating hash #4386
-
I compiled my botan lib as static and with zlib support for x86, but I'm getting some very strange errors I suspect it's the lib First I compiled the lib as follows python configure.py --cc=msvc --os=windows --cpu=x86 --disable-shared --build-targets=static --without-debug-info --prefix=build\x86 --with-zlib --with-external-includedir=MyPasteZlibInclude --with-external-libdir=MyPastZlibLib I'm using botan in an x86 dll compiled in release I wrote the following code: Botan::secure_vector<uint8_t> GHash(std::vector<uint8_t> input) {
MessageBoxA(NULL, "Init", "Test", MB_OK);
std::unique_ptr<Botan::HashFunction> hash_function = Botan::HashFunction::create_or_throw("SHA-256");
MessageBoxA(NULL, "pos", "Test", MB_OK);
hash_function->update(input);
return hash_function->final();
}
void GenerateHashFile(std::vector<uint8_t>& filebytes) {
MessageBoxA(NULL, "initHash", "test", MB_OK);
Botan::secure_vector<uint8_t> Hash1 = GHash(filebytes);
MessageBoxA(NULL, "ok", "test", MB_OK);
Botan::secure_vector<uint8_t> checkBytes = { ... };
....
} When running my code on x86 release the program stops working on When you call If I comment
Does anyone have any suspicions as to what it could be? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Almost certainly it is not a bug in the library's implementation itself, as this is code that has been tested and used successfully by many others. We've seen similar failure modes before. Namely "the application just crashes on the first invocation of the library on Windows". Often this indicates that the user had an issue in their build system. For instance:
The above points may also apply to the zlib integration, which you don't seem to use (yet). Perhaps try building Botan without zlib and make a small test program that doesn't actually use any zlib functionality to rule out issues there. Unfortunately, I'm rarely developing on the Windows platform and I can't give much more guidance off the top of my head. |
Beta Was this translation helpful? Give feedback.
-
I managed to get it to work using |
Beta Was this translation helpful? Give feedback.
Almost certainly it is not a bug in the library's implementation itself, as this is code that has been tested and used successfully by many others.
We've seen similar failure modes before. Namely "the application just crashes on the first invocation of the library on Windows". Often this indicates that the user had an issue in their build system. For instance:
(Botan uses
/MD
by default, but you could try configuring with--msvc-ru…