Search code examples
linuxpython-2.7segmentation-faulthashlib

Python 2.7 "import hashlib" segmentation fault


Whenever I try to import hashlib in Python 2.7 I get a segmentation fault. I've installed openssl version 1.0.0, pyOpenssl version .10, and recompiled python with the ssl lines uncommented in Modules/Setup, pointing to the correct path for the libraries and include files for openssl.

I've run ldd on all the libraries I can find that might use libssl or libcrypto, and they're all pointing to the same versions of the files.

gdb returns: 0x0000003d1d0f670 in EVP_PKEY_CTX_dup () from /usr/lib64/libcrypto.so.1.0.0

Any ideas what might be going on, and how to repair it?


Solution

  • hashlib uses libcrypto for hash algorithms if it can find libcrypto while building python.

    I suspect somehow it's ending up using a different libcrypto at runtime vs. build time.