GoboLinux Downloads Documentation Community Recipes Screenshots

GoboLinux Recipe & Package Search Tool

13 versions of DB.

ProgramAgeSizeByWWWSummary
DB 6.2.23-r1 1397  1032 Luca...
Berkeley DB Database Library
DB 6.0.20-r1 2340  1025 Hish...
Berkeley DB Database Library
DB 5.1.19-r2 1278  1025 Luca...
Berkeley DB Database Library
DB 4.8.26-r2 3798  1017 Zbig...
Berkeley DB Database Library
DB 4.7.25-r2 4105  989 Raph...
Berkeley DB Database Library
DB 4.6.21-r2 4105  2086 Giam...
Berkeley DB Database Library
view entry at GitHub | download recipe.bz2 file
01-race_condition_fix.patch
Recipe
Resources/BuildInformation
Resources/Dependencies
Resources/Description
Submitted By: Jeremy Huntwork (jhuntwork at linuxfromscratch dot org)
Date: 2008-04-02
Initial Package Version: 4.6.21
Upstream Status: From Upstream
Origin: http://www.oracle.com/technology/products/berkeley-db/xml/update/4.6.21/patch.4.6.21.html
Description: "Fixes a race condition between checkpoint and DB->close which can
result in the checkpoint thread self-deadlocking."

diff -Naur db-4.6.21-orig/dbinc/mp.h db-4.6.21/dbinc/mp.h
--- db-4.6.21-orig/dbinc/mp.h	2007-09-27 11:28:25.000000000 -0400
+++ db-4.6.21/dbinc/mp.h	2008-04-02 22:22:33.000000000 -0400
@@ -639,6 +639,9 @@
  */
 #define	MP_TRUNC_RECOVER	0x01
 
+/* Private flags to DB_MPOOLFILE->close. */
+#define	DB_MPOOL_NOLOCK		0x002	/* Already have mpf locked. */
+
 #if defined(__cplusplus)
 }
 #endif
diff -Naur db-4.6.21-orig/mp/mp_fopen.c db-4.6.21/mp/mp_fopen.c
--- db-4.6.21-orig/mp/mp_fopen.c	2007-05-17 13:18:01.000000000 -0400
+++ db-4.6.21/mp/mp_fopen.c	2008-04-02 22:22:33.000000000 -0400
@@ -888,7 +888,8 @@
 	 * when we try to flush them.
 	 */
 	deleted = 0;
-	MUTEX_LOCK(dbenv, mfp->mutex);
+	if (!LF_ISSET(DB_MPOOL_NOLOCK))
+		MUTEX_LOCK(dbenv, mfp->mutex);
 	if (F_ISSET(dbmfp, MP_MULTIVERSION))
 		--mfp->multiversion;
 	if (--mfp->mpf_cnt == 0 || LF_ISSET(DB_MPOOL_DISCARD)) {
@@ -909,13 +910,19 @@
 			}
 		}
 		if (mfp->block_cnt == 0) {
+			/*
+			 * We should never discard this mp file if our caller
+			 * is holding the lock on it.  See comment in
+			 * __memp_sync_file.
+			 */
+			DB_ASSERT(dbenv, !LF_ISSET(DB_MPOOL_NOLOCK));
 			if ((t_ret =
 			    __memp_mf_discard(dbmp, mfp)) != 0 && ret == 0)
 				ret = t_ret;
 			deleted = 1;
 		}
 	}
-	if (!deleted)
+	if (!deleted && !LF_ISSET(DB_MPOOL_NOLOCK))
 		MUTEX_UNLOCK(dbenv, mfp->mutex);
 
 done:	/* Discard the DB_MPOOLFILE structure. */
diff -Naur db-4.6.21-orig/mp/mp_sync.c db-4.6.21/mp/mp_sync.c
--- db-4.6.21-orig/mp/mp_sync.c	2007-06-01 14:32:44.000000000 -0400
+++ db-4.6.21/mp/mp_sync.c	2008-04-02 22:22:33.000000000 -0400
@@ -755,7 +755,8 @@
 	 * This is important since we are called with the hash bucket
 	 * locked.  The mfp will get freed via the cleanup pass.
 	 */
-	if (dbmfp != NULL && (t_ret = __memp_fclose(dbmfp, 0)) != 0 && ret == 0)
+	if (dbmfp != NULL &&
+	    (t_ret = __memp_fclose(dbmfp, DB_MPOOL_NOLOCK)) != 0 && ret == 0)
 		ret = t_ret;
 
 	--mfp->mpf_cnt;
DB 4.5.20-r4 3759  2136 Andr...
Berkeley DB Database Library
DB 4.4.20-r2 4105  2703 Jona...
Berkeley DB Database Library
DB 4.3.29-r1 4105  896 Fern...
Berkeley DB Database Library
DB 4.3.28-r1 4105  859 Andr...
Berkeley DB Database Library
DB 4.3.27-r1 4105  908 roko
Berkeley DB Database Library
DB 4.3.21-r1 4105  550 Andr...
Deep Blue is a theme built around an ocean background.
DB 4.2.52-r1 4105  496
Deep Blue is a theme built around an ocean background.