DEV Community

Rui Vieira
Rui Vieira

Posted on

Fixing libcrypto ansible crashes on macOS

Recently, I was having consistent crashes on macOS with ansible when running certain playbooks (especially when deploying to OpenShift). These errors were quite non-informative since the only feedback I got was, for instance:

[1]    71538 abort      pipenv run ansible-playbook deploy_kafka_operator.yaml -e  -e NAMESPACE=...

The cause

Looking at the crash dump I could find the following information:

Crashed Thread:        0  Dispatch queue:

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.

Thread 0 Crashed:: Dispatch queue:
0   libsystem_kernel.dylib          0x00007fff6fb1e7fa __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff6fbdbbc1 pthread_kill + 432
2   libsystem_c.dylib               0x00007fff6faa5a1c abort + 120
3   libcrypto.dylib                 0x00007fff6d40d804 __report_load + 352
4   dyld                            0x00000001113e615d ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 539

OK. So I shouldn't load the unversioned libcrypto. I kinda I knew that, but that doing it willingly...

The fix

First things first. Make sure you have the latest libcrypto installed (using brew, in my case):

$ brew update ; brew upgrade ; brew install openssl

Next, from the installed openssl (in my case, located at /usr/local/Cellar/openssl/1.0.2t/) copy the following two libraries to /usr/local/lib:

$ cd /usr/local/Cellar/openssl/1.0.2t/
$ sudo cp libcrypto.1.0.0.dylib libssl.1.0.0.dylib /usr/local/lib

The next step is to symlink them:

$ cd /usr/local/lib
$ sudo ln -s libssl.1.0.0.dylib libssl.dylib
$ sudo ln -s libcrypto.1.0.0.dylib libcrypto.dylib

Lo and behold, problem fixed.

Discussion (0)