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: com.apple.main-thread

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

Application Specific Information:
/usr/lib/libcrypto.dylib
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: com.apple.main-thread
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.

Top comments (1)

Collapse
 
sparsh9 profile image
Sparsh Garg

Click to view Error Screenshot

I'm trying to install Ruby version 2.7.x with Rails 5.2.x on MacBook Pro 2017 (Intel Chip), And I'm getting this error, as shown in image, I have tried above solution but that didn't work for me. I would really appreciate your help, Thanks