在使用 Crypto++ 的 zlib 函数的程序上,我遇到了一个奇怪的 valgrind 错误:
vex x86->IR: unhandled instruction bytes: 0xC5 0xF9 0x6E 0x45
==8605== valgrind: Unrecognised instruction at address 0x814c88b.
==8605== at 0x814C88B: CryptoPP::ByteQueue::TransferTo2(CryptoPP::BufferedTransformation&, unsigned long long&, std::string const&, bool) (misc.h:189)
==8605== by 0x814C3E6: CryptoPP::ByteQueue::Get(unsigned char*, unsigned int) (cryptlib.h:901)
==8605== by 0x815DAAE: CryptoPP::ZlibDecompressor::ProcessPoststreamTail() (zlib.cpp:84)
==8605== by 0x815B6EC: CryptoPP::Inflator::ProcessInput(bool) (zinflate.cpp:349)
==8605== by 0x815BC25: CryptoPP::Inflator::Put2(unsigned char const*, unsigned int, int, bool) (zinflate.cpp:295)
==8605== by 0x805E40C: CryptoPP::BufferedTransformation::Put(unsigned char const*, unsigned int, bool) (cryptlib.h:789)
我知道 Crypto++ 在某些领域使用一些手工编码的程序集来加快速度,而且我读过以 0xC5 开头的指令永远不会出现在编译代码中。这可能是由于来自一块手工编码的汇编的汇编指令吗?如果是这样,我可以通过 valgrind 禁用此检查,以便我可以继续测试我的程序吗?