<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 11/6/2019 3:03 AM, Frederick Gotham
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:XnsAAFF7088E9C4Cfgotham@195.159.176.226">
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">I used GDB on the core file and saw the following backtrace:
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">

I think I'm actually getting a stack overflow from "openssl_config_int" 
calling "OPENSSL_init_crypto" because of the recursion.
</pre>
    </blockquote>
    <br>
    No, a stack overflow would be much deeper.<br>
    <br>
    <blockquote type="cite">
      <pre class="moz-quote-pre" wrap="">#0  0x00007f656e35e3c7 in __pthread_once_slow () from /lib/libpthread.so.0
(gdb) bt
#0  0x00007f656e35e3c7 in __pthread_once_slow () from /lib/libpthread.so.0
#1  0x00007f656f730fbe in CRYPTO_THREAD_run_once () from ./libcrypto.so.1.1
#2  0x00007f656f6d5c80 in OPENSSL_init_crypto () from ./libcrypto.so.1.1
#3  0x00007f656f66163b in openssl_config_int () from ./libcrypto.so.1.1
#4  0x00007f656f6d56cf in ossl_init_config_ossl_ () from ./libcrypto.so.1.1
#5  0x00007f656e35e407 in __pthread_once_slow () from /lib/libpthread.so.0
#6  0x00007f656f730fbe in CRYPTO_THREAD_run_once () from ./libcrypto.so.1.1
#7  0x00007f656f6d5c80 in OPENSSL_init_crypto () from ./libcrypto.so.1.1
#8  0x000055a8d125708b in main ()
</pre>
    </blockquote>
    <br>
    Note that __pthread_once_slow is in the stack twice, called from
    OPENSSL_init_crypto and CRYPTO_THREAD_run_once.<br>
    <br>
    "once" functions ensure that they call their function argument
    exactly once, even if they are called multiple times in parallel
    while their function is running.  They do that by locking a mutex
    around the execution of the function.  The second call attempted to
    lock the mutex to wait for the first call to complete, and
    deadlocked.<br>
    <br>
    <br>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Jordan Brown, Oracle ZFS Storage Appliance, Oracle Solaris</pre>
  </body>
</html>