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

Python: Unable to import cryptography package due to 'cannot enable executable stack...' #2431

Closed
derekbekoe opened this issue Aug 17, 2017 · 2 comments

Comments

@derekbekoe
Copy link

  • Your Windows build number: (Type ver at a Windows Command Prompt)
Microsoft Windows [Version 10.0.15063]
  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)
    Steps to repro (I start from a fresh Windows VM with WSL installed):
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python3 get-pip.py
$ python3 -m pip install cryptography==2.0.1
$ python3 -c "from cryptography.hazmat.bindings._openssl import ffi"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /usr/local/lib/python3.5/dist-packages/cryptography/hazmat/bindings/_openssl.abi3.so: cannot enable executable stack as shared object requires: Invalid argument
$ echo $?
1

I specify 2.0.1 as that was when the issue appeared (it also fails on new releases since then).
It works with cryptography 2.0 however...

$ python3 -m pip install cryptography==2.0
$ python3 -c "from cryptography.hazmat.bindings._openssl import ffi"
$ echo $?
0
  • What's wrong / what should be happening instead:

What should be happening is with newer versions of cryptography, the import should work and so the exit code of python3 -c "from cryptography.hazmat.bindings._openssl import ffi" should be 0.

  • Strace of the failing command, if applicable: (If <cmd> is failing, then run strace -o strace.txt -ff <cmd>, and post the strace.txt output here)

Attached is the output of strace -o strace.txt -ff python3 -c "from cryptography.hazmat.bindings._openssl import ffi" with cryptography==2.0.1:

strace.txt

The original issue is from Azure CLI Azure/azure-cli#4154.

This seems somewhat related to the following as they both show the error cannot enable executable stack as shared object requires: Invalid argument:
#1128
#286

@derekbekoe
Copy link
Author

Also, here is the change log for cryptography is that helps https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst#201---2017-07-26

@benhillis
Copy link
Member

Thanks for posting, this is the same issue as #286 (lack of support for executable stack).

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

No branches or pull requests

2 participants