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

Undefined symbol "CRYPTO_malloc_debug_init" on FreeBSD #1332

Closed
a1exus opened this issue Nov 4, 2015 · 17 comments · Fixed by pyca/cryptography#2466
Closed

Undefined symbol "CRYPTO_malloc_debug_init" on FreeBSD #1332

a1exus opened this issue Nov 4, 2015 · 17 comments · Fixed by pyca/cryptography#2466

Comments

@a1exus
Copy link

a1exus commented Nov 4, 2015

I'm trying to follow Quick Start and I'm getting some errors:

[alexus@j ~]$   git clone https://github.com/letsencrypt/letsencrypt
Cloning into 'letsencrypt'...
remote: Counting objects: 22683, done.
remote: Total 22683 (delta 0), reused 0 (delta 0), pack-reused 22683
Receiving objects: 100% (22683/22683), 5.86 MiB | 8.36 MiB/s, done.
Resolving deltas: 100% (15778/15778), done.
Checking connectivity... done.
[alexus@j ~]$   cd letsencrypt
[alexus@j ~/letsencrypt]$   ./letsencrypt-auto --agree-dev-preview --server \
>       https://acme-v01.api.letsencrypt.org/directory certonly
Bootstrapping dependencies for FreeBSD...
Password:
+ pkg install -Ay git python py27-virtualenv augeas libffi
Updating FreeBSD repository catalogue...
[j.alexus.biz] Fetching meta.txz: 100%    964 B   1.0kB/s    00:01    
[j.alexus.biz] Fetching packagesite.txz: 100%    5 MiB   5.5MB/s    00:01    
Processing entries: 100%
FreeBSD repository update completed. 24464 packages processed.

p5-DBD-mysql-4.028_1 is locked and may not be modified
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    python: 2.7_2,2
    py27-virtualenv: 13.1.0
    augeas: 1.4.0

The process will require 6 MiB more space.
2 MiB to be downloaded.
[j.alexus.biz] Fetching python-2.7_2,2.txz: 100%    1 KiB   1.0kB/s    00:01    
[j.alexus.biz] Fetching py27-virtualenv-13.1.0.txz: 100%    2 MiB   2.1MB/s    00:01    
[j.alexus.biz] Fetching augeas-1.4.0.txz: 100%  561 KiB 575.0kB/s    00:01    
Checking integrity... done (0 conflicting)
[j.alexus.biz] [1/3] Installing python-2.7_2,2...
[j.alexus.biz] [1/3] Extracting python-2.7_2,2: 100%
[j.alexus.biz] [2/3] Installing py27-virtualenv-13.1.0...
[j.alexus.biz] [2/3] Extracting py27-virtualenv-13.1.0: 100%
[j.alexus.biz] [3/3] Installing augeas-1.4.0...
[j.alexus.biz] [3/3] Extracting augeas-1.4.0: 100%
Creating virtual environment...
Updating letsencrypt and virtual environment dependencies...You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
.You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
..
Running with virtualenv: sudo /home/alexus/.local/share/letsencrypt/bin/letsencrypt --agree-dev-preview --server https://acme-v01.api.letsencrypt.org/directory certonly
Traceback (most recent call last):
  File "/home/alexus/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
    from letsencrypt.cli import main
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/letsencrypt/cli.py", line 15, in <module>
    import OpenSSL
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: Undefined symbol "CRYPTO_malloc_debug_init"
[alexus@j ~/letsencrypt]$ uname -a
FreeBSD X 9.2-RELEASE-p17 FreeBSD 9.2-RELEASE-p17 #0 r282430: Mon May  4 13:59:58 PDT 2015     root@X:/usr/obj/usr/src/sys/R610  amd64
[alexus@j ~/letsencrypt]$ 

@animetauren
Copy link

Try doing the pip update to 7.1.2 and try again. Just a suggestion.

@a1exus
Copy link
Author

a1exus commented Nov 4, 2015

@animetauren, I don't have pip installed on system at all, I believe pip came from git pull and if pip must be at higher version number, then it should be included inside of git repository:

[alexus@j ~]$ ll ./.local/share/letsencrypt/bin/pip
-rwxr-xr-x  1 alexus  users  238 Nov  4 11:17 ./.local/share/letsencrypt/bin/pip
[alexus@j ~]$ ./.local/share/letsencrypt/bin/pip --version
pip 7.1.2 from /home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages (python 2.7)
[alexus@j ~/letsencrypt]$ pip
-bash: pip: command not found
[alexus@j ~/letsencrypt]$ 

@kuba
Copy link
Contributor

kuba commented Nov 4, 2015

Error that stands out: ImportError: /home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: Undefined symbol "CRYPTO_malloc_debug_init".

@alex, please help? :( Is cryptography compatible with FreeBSD?

@kuba kuba changed the title Let's Encrypt Closed Beta Invite Undefined symbol "CRYPTO_malloc_debug_init" on FreeBSD Nov 4, 2015
@alex
Copy link
Collaborator

alex commented Nov 4, 2015

@kuba Yup, FreeBSD 10 is part of our buildbot suite. /cc @reaperhulk @dstufft

@a1exus
Copy link
Author

a1exus commented Nov 4, 2015

@kuba My environment is FreeBSD 9.2-RELEASE-p17.

@reaperhulk
Copy link
Collaborator

We don't test against FreeBSD 9.x, but CRYPTO_malloc_debug_init has cropped up before on other platforms. This is a macro so it is very strange that the linker is attempting to resolve the symbol. We don't use this function (and neither does pyOpenSSL) so I think we should just remove it rather than continue to experience this issue sporadically. I'll put in a PR and we can discuss it there.

@reaperhulk
Copy link
Collaborator

@a1exus we've merged a change to https://github.com/pyca/cryptography that should stop this error. Would you mind cloning master and seeing if you can install it successfully?

@a1exus
Copy link
Author

a1exus commented Nov 5, 2015

@reaperhulk unless I'm doing something wrong, I'm still hitting same error:

[alexus@j ~/letsencrypt]$ git pull
remote: Counting objects: 106, done.
remote: Total 106 (delta 78), reused 78 (delta 78), pack-reused 28
Receiving objects: 100% (106/106), 17.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (78/78), completed with 24 local objects.
From https://github.com/letsencrypt/letsencrypt
   de18294..f67fab6  master     -> origin/master
 * [new branch]      1342       -> origin/1342
 * [new branch]      both       -> origin/both
 * [new branch]      dev-warnings -> origin/dev-warnings
 * [new branch]      mac-install -> origin/mac-install
Updating de18294..f67fab6
Fast-forward
 .travis.yml                      |  7 +++++--
 docs/contributing.rst            |  8 +++++++-
 letsencrypt/client.py            | 20 +++++++++++++++++++-
 letsencrypt/plugins/webroot.py   |  6 +++---
 letsencrypt/tests/client_test.py | 21 +++++++++++++++++++++
 5 files changed, 55 insertions(+), 7 deletions(-)
[alexus@j ~/letsencrypt]$ ./letsencrypt-auto --agree-dev-preview --server \
> https://acme-v01.api.letsencrypt.org/directory certonly
Updating letsencrypt and virtual environment dependencies......
Running with virtualenv: sudo /home/alexus/.local/share/letsencrypt/bin/letsencrypt --agree-dev-preview --server https://acme-v01.api.letsencrypt.org/directory certonly
Password:
Traceback (most recent call last):
  File "/home/alexus/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
    from letsencrypt.cli import main
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/letsencrypt/cli.py", line 15, in <module>
    import OpenSSL
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: Undefined symbol "CRYPTO_malloc_debug_init"
[alexus@j ~/letsencrypt]$ 

@reaperhulk
Copy link
Collaborator

We haven't done a new release of cryptography with this fix so you'll have to install it directly from github (not the lets encrypt GitHub repo, which will pull in the released cryptography dependency)

On Nov 6, 2015, at 12:51 AM, alexus notifications@github.com wrote:

@reaperhulk unless I'm doing something wrong, I'm still hitting same error:

[alexus@j ~/letsencrypt]$ git pull
remote: Counting objects: 106, done.
remote: Total 106 (delta 78), reused 78 (delta 78), pack-reused 28
Receiving objects: 100% (106/106), 17.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (78/78), completed with 24 local objects.
From https://github.com/letsencrypt/letsencrypt
de18294..f67fab6 master -> origin/master

  • [new branch] 1342 -> origin/1342
  • [new branch] both -> origin/both
  • [new branch] dev-warnings -> origin/dev-warnings
  • [new branch] mac-install -> origin/mac-install
    Updating de18294..f67fab6
    Fast-forward
    .travis.yml | 7 +++++--
    docs/contributing.rst | 8 +++++++-
    letsencrypt/client.py | 20 +++++++++++++++++++-
    letsencrypt/plugins/webroot.py | 6 +++---
    letsencrypt/tests/client_test.py | 21 +++++++++++++++++++++
    5 files changed, 55 insertions(+), 7 deletions(-)
    [alexus@j ~/letsencrypt]$ ./letsencrypt-auto --agree-dev-preview --server \

    https://acme-v01.api.letsencrypt.org/directory certonly
    Updating letsencrypt and virtual environment dependencies......
    Running with virtualenv: sudo /home/alexus/.local/share/letsencrypt/bin/letsencrypt --agree-dev-preview --server https://acme-v01.api.letsencrypt.org/directory certonly
    Password:
    Traceback (most recent call last):
    File "/home/alexus/.local/share/letsencrypt/bin/letsencrypt", line 7, in
    from letsencrypt.cli import main
    File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/letsencrypt/cli.py", line 15, in
    import OpenSSL
    File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/init.py", line 8, in
    from OpenSSL import rand, crypto, SSL
    File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in
    from OpenSSL._util import (
    File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in
    from cryptography.hazmat.bindings.openssl.binding import Binding
    File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in
    from cryptography.hazmat.bindings._openssl import ffi, lib
    ImportError: /home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: Undefined symbol "CRYPTO_malloc_debug_init"
    [alexus@j ~/letsencrypt]$

    Reply to this email directly or view it on GitHub.

@a1exus
Copy link
Author

a1exus commented Nov 8, 2015

Can you advise how to do install pyca/cryptography? I did git pull)

@reaperhulk
Copy link
Collaborator

cd into the cryptography git repo, then pip install . from within the virtualenv you want it installed into.

@a1exus
Copy link
Author

a1exus commented Nov 8, 2015

hopefully I did it correct:

[alexus@j ~/letsencrypt]$ source bin/activate
(letsencrypt)[alexus@j ~/letsencrypt]$ cd ~/cryptography/
(letsencrypt)[alexus@j ~/cryptography]$ pip install .
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Processing /usr/home/alexus/cryptography
Collecting idna>=2.0 (from cryptography==1.2.dev1)
  Using cached idna-2.0-py2.py3-none-any.whl
Collecting pyasn1>=0.1.8 (from cryptography==1.2.dev1)
  Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Collecting six>=1.4.1 (from cryptography==1.2.dev1)
  Using cached six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/home/alexus/letsencrypt/lib/python2.7/site-packages (from cryptography==1.2.dev1)
Collecting enum34 (from cryptography==1.2.dev1)
Collecting ipaddress (from cryptography==1.2.dev1)
  Using cached ipaddress-1.0.14-py27-none-any.whl
Collecting cffi>=1.1.0 (from cryptography==1.2.dev1)
Collecting pycparser (from cffi>=1.1.0->cryptography==1.2.dev1)
Installing collected packages: idna, pyasn1, six, enum34, ipaddress, pycparser, cffi, cryptography
  Running setup.py install for cryptography
Successfully installed cffi-1.3.0 cryptography-1.2.dev1 enum34-1.0.4 idna-2.0 ipaddress-1.0.14 pyasn1-0.1.9 pycparser-2.14 six-1.10.0
(letsencrypt)[alexus@j ~/cryptography]$ 

yet, letsencrypt still errors out:

[alexus@j ~/letsencrypt]$ ./letsencrypt-auto --agree-dev-preview --server \
> https://acme-v01.api.letsencrypt.org/directory certonly
Updating letsencrypt and virtual environment dependencies.....Requirement already satisfied (use --upgrade to upgrade): ConfigArgParse from git+https://github.com/kuba/ConfigArgParse.git@python2.6-0.9.3#egg=ConfigArgParse in /usr/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages (from -r py26reqs.txt (line 1))
..
Running with virtualenv: sudo /home/alexus/.local/share/letsencrypt/bin/letsencrypt --agree-dev-preview --server https://acme-v01.api.letsencrypt.org/directory certonly
Password:
Traceback (most recent call last):
  File "/home/alexus/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
    from letsencrypt.cli import main
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/letsencrypt/cli.py", line 15, in <module>
    import OpenSSL
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /home/alexus/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: Undefined symbol "CRYPTO_malloc_debug_init"
[alexus@j ~/letsencrypt]$ 

@reaperhulk
Copy link
Collaborator

Try running this from within your virtualenv: python -c "from cryptography.hazmat.backends.openssl.backend import backend;print(backend.openssl_version_text())" If it prints openssl version information then the bug has been resolved, but the lets encrypt preview is still installing cryptography somewhere else.

@a1exus
Copy link
Author

a1exus commented Nov 8, 2015

I got openssl version information:

(letsencrypt)[alexus@j ~/letsencrypt]$ python -c "from cryptography.hazmat.backends.openssl.backend import backend;print(backend.openssl_version_text())"
OpenSSL 1.0.2d 9 Jul 2015
(letsencrypt)[alexus@j ~/letsencrypt]$

@reaperhulk
Copy link
Collaborator

Looks like the preview is installing everything into /home/alexus/.local/share/letsencrypt. If that's a virtualenv you can uninstall the cryptography in there and install the git version, but otherwise I'm not familiar enough with how letsencrypt installs to help further. 😞 We'll be discussing doing a cryptography release with this fix backported soon though.

@reaperhulk
Copy link
Collaborator

This has now been released in 1.1.1

@a1exus
Copy link
Author

a1exus commented Nov 23, 2015

I believe this issue is resolved, as now I'm getting another issue:

No matching distribution found for acme==0.0.0.dev20151123 (from letsencrypt) · Issue #1601

@a1exus a1exus closed this as completed Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants