Hi,
This one is giving me really hard time. I'm trying to build crypto++ with msvc / windows - compilation works fine, but always when I want to use the lib I keep getting
block at 0x000001362708B180 was not allocated by _aligned routines, use free()
After debugging the code I can see that the problem is in allocate.cpp
void AlignedDeallocate(void *p)
{
// Guard pointer due to crash on AIX when CRYPTOPP_NO_ALIGNED_ALLOC
// is in effect. The guard was previously in place in SecBlock,
// but it was removed at f4d68353ca7c as part of GH #875.
CRYPTOPP_ASSERT(p);
if (p != NULLPTR)
{
#ifdef CRYPTOPP_MM_MALLOC_AVAILABLE
_mm_free(p);
#elif defined(CRYPTOPP_NO_ALIGNED_ALLOC)
p = (byte *)p - ((byte *)p)[-1];
free(p);
#else
free(p);
#endif
}
}
If I understand it correctly then the allocation wasn't done with aligned, but with malloc?
Did anyone had similar issue?
Just on the side I'm of course hitting the old, where _MSC_VER and __clang__ are defined. SO far I haven't find any workaround on this either.
// discussed at
http://github.com/weidai11/cryptopp/issues/147.
#if (defined(_MSC_VER) && defined(__clang__) && \
!(defined( __clang_analyzer__)) && !defined(__INTEL_LLVM_COMPILER))
# error: "Unsupported configuration"
#endif
Will be more than thankful for any kind of help in this.
Regards,
/m