[openssl] master update

Dr. Paul Dale pauli at openssl.org
Thu Mar 11 22:00:41 UTC 2021

The branch master has been updated
       via  3d8905f85945d899192b113ae495e99894687c4f (commit)
      from  0a8e6c1fb77612feba350a67dad3e548300785a7 (commit)

- Log -----------------------------------------------------------------
commit 3d8905f85945d899192b113ae495e99894687c4f
Author: Rich Salz <rsalz at akamai.com>
Date:   Thu Feb 18 16:27:08 2021 -0500

    Fix error-checking compiles for mutex
    Fixes: #14229
    Reviewed-by: Kurt Roeckx <kurt at roeckx.be>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/14264)


Summary of changes:
 INSTALL.md               | 7 +++++++
 crypto/threads_pthread.c | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/INSTALL.md b/INSTALL.md
index 01c360e8d4..d6ef21d20e 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1666,6 +1666,13 @@ most UNIX/Linux systems), and Windows threads.  No other threading models are
 supported.  If your platform does not provide pthreads or Windows threads then
 you should use `Configure` with the `no-threads` option.
+For pthreads, all locks are non-recursive. In addition, in a debug build,
+the mutex attribute `PTHREAD_MUTEX_ERRORCHECK` is used. If this is not
+available on your platform, you might have to add
+`-DOPENSSL_NO_MUTEX_ERRORCHECK` to your `Configure` invocation.
+(On Linux `PTHREAD_MUTEX_ERRORCHECK` is an enum value, so a built-in
+ifdef test cannot be used.)
 Notes on shared libraries
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 3004e1bd2f..e81f3cf1ef 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -55,7 +55,7 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
      * We don't use recursive mutexes, but try to catch errors if we do.
-#  if defined(NDEBUG) && defined(PTHREAD_MUTEX_ERRORCHECK)
+#  if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
     pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
 # else
     pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);

More information about the openssl-commits mailing list