<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rui Vieira</title>
    <description>The latest articles on DEV Community by Rui Vieira (@ruivieira).</description>
    <link>https://dev.to/ruivieira</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F351601%2F538f6a01-ee5a-460d-b2b9-d76bb2cf398e.jpg</url>
      <title>DEV Community: Rui Vieira</title>
      <link>https://dev.to/ruivieira</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ruivieira"/>
    <language>en</language>
    <item>
      <title>Fixing libcrypto ansible crashes on macOS</title>
      <dc:creator>Rui Vieira</dc:creator>
      <pubDate>Wed, 18 Mar 2020 22:45:10 +0000</pubDate>
      <link>https://dev.to/ruivieira/fixing-libcrypto-ansible-crashes-on-macos-mm2</link>
      <guid>https://dev.to/ruivieira/fixing-libcrypto-ansible-crashes-on-macos-mm2</guid>
      <description>&lt;p&gt;Recently, I was having consistent crashes on macOS with &lt;code&gt;ansible&lt;/code&gt; when running certain playbooks (especially when deploying to OpenShift). These errors were quite non-informative since the only feedback I got was, for instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[1]    71538 abort      pipenv run ansible-playbook deploy_kafka_operator.yaml -e  -e NAMESPACE=...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  The cause
&lt;/h2&gt;

&lt;p&gt;Looking at the crash dump I could find the following information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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&amp;amp;) + 539
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;OK. So I &lt;em&gt;shouldn't&lt;/em&gt; load the unversioned &lt;code&gt;libcrypto&lt;/code&gt;. I kinda I knew that, but that doing it &lt;em&gt;willingly&lt;/em&gt;...&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;First things first. Make sure you have the latest &lt;code&gt;libcrypto&lt;/code&gt; installed (using &lt;code&gt;brew&lt;/code&gt;, in my case):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew update &lt;span class="p"&gt;;&lt;/span&gt; brew upgrade &lt;span class="p"&gt;;&lt;/span&gt; brew &lt;span class="nb"&gt;install &lt;/span&gt;openssl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next, from the installed &lt;code&gt;openssl&lt;/code&gt; (in my case, located at &lt;code&gt;/usr/local/Cellar/openssl/1.0.2t/&lt;/code&gt;) copy the following two libraries to &lt;code&gt;/usr/local/lib&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /usr/local/Cellar/openssl/1.0.2t/
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo cp &lt;/span&gt;libcrypto.1.0.0.dylib libssl.1.0.0.dylib /usr/local/lib
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The next step is to symlink them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd /usr/local/lib
$ sudo ln -s libssl.1.0.0.dylib libssl.dylib
$ sudo ln -s libcrypto.1.0.0.dylib libcrypto.dylib
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Lo and behold, problem fixed.&lt;/p&gt;

</description>
      <category>ansible</category>
      <category>openssl</category>
      <category>fix</category>
      <category>macos</category>
    </item>
  </channel>
</rss>
