https://bugs.openldap.org/show_bug.cgi?id=9278

--- Comment #14 from Xin Li <[email protected]> ---
(In reply to Howard Chu from comment #12)
> We're going to revert this patch due to all the new race conditions it
> introduces (see other ITSs noted above). No other platforms have the problem
> reported here, so we must consider it a bug in FreeBSD that munmapping a
> mutex doesn't automatically perform all of the necessary libc cleanup itself.

Hi, thanks for the headsup.  Yes, it appears that the underlying issue was
fixed earlier this year ( https://bugs.freebsd.org/269277 ).

Could you please revert just the older workaround portion, e.g.:

```
diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c
index 6e4c4d0..965ba2a 100644
--- a/libraries/liblmdb/mdb.c
+++ b/libraries/liblmdb/mdb.c
@@ -5824,17 +5824,6 @@ mdb_env_close0(MDB_env *env, int excl)
                        if (excl > 0)
                                semctl(env->me_rmutex->semid, 0, IPC_RMID);
                }
-#elif defined(MDB_ROBUST_SUPPORTED)
-               /* If we have the filelock:  If we are the
-                * only remaining user, clean up robust
-                * mutexes.
-                */
-               if (excl == 0)
-                       mdb_env_excl_lock(env, &excl);
-               if (excl > 0) {
-                       pthread_mutex_destroy(env->me_txns->mti_rmutex);
-                       pthread_mutex_destroy(env->me_txns->mti_wmutex);
-               }
 #endif
                munmap((void *)env->me_txns,
(env->me_maxreaders-1)*sizeof(MDB_reader)+sizeof(MDB_txninfo));
        }
```

and leave the rest (enabling robust mutexes on FreeBSD) as-is?

-- 
You are receiving this mail because:
You are on the CC list for the issue.

Reply via email to