rpms/db4/F-10 patch.4.7.25.2, NONE, 1.1 patch.4.7.25.3, NONE, 1.1 db4.spec, 1.65, 1.66
Jindrich Novy
jnovy at fedoraproject.org
Tue Dec 23 17:01:57 UTC 2008
- Previous message (by thread): rpms/ruby-qpid/F-9 .cvsignore, 1.4, 1.5 ruby-qpid.spec, 1.3, 1.4 sources, 1.4, 1.5
- Next message (by thread): rpms/db4/F-9 patch.4.6.21.3,NONE,1.1 db4.spec,1.58,1.59
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: jnovy
Update of /cvs/pkgs/rpms/db4/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8174
Modified Files:
db4.spec
Added Files:
patch.4.7.25.2 patch.4.7.25.3
Log Message:
* Tue Dec 23 2008 Jindrich Novy <jnovy at redhat.com> 4.7.25-7
- DB_ENV->lock_get may self deadlock if user defined locks
are used and there is only one lock partition defined
(upstream bz#16415)
- fix for dd segfaults (upstream bz#16541)
- reorder patches
- nuke useless libtool hacks
--- NEW FILE patch.4.7.25.2 ---
Index: lock/lock.c
===================================================================
RCS file: /a/CVSROOT/db/lock/lock.c,v
retrieving revision 12.61
diff -c -r12.61 lock.c
*** lock/lock.c 22 Jul 2008 12:08:53 -0000 12.61
--- lock/lock.c 19 Aug 2008 17:28:24 -0000
***************
*** 1278,1287 ****
SH_TAILQ_REMOVE(
<->obj_tab[obj_ndx], sh_obj, links, __db_lockobj);
if (sh_obj->lockobj.size > sizeof(sh_obj->objdata)) {
! LOCK_REGION_LOCK(env);
__env_alloc_free(<->reginfo,
SH_DBT_PTR(&sh_obj->lockobj));
! LOCK_REGION_UNLOCK(env);
}
SH_TAILQ_INSERT_HEAD(
&FREE_OBJS(lt, part_id), sh_obj, links, __db_lockobj);
--- 1278,1289 ----
SH_TAILQ_REMOVE(
<->obj_tab[obj_ndx], sh_obj, links, __db_lockobj);
if (sh_obj->lockobj.size > sizeof(sh_obj->objdata)) {
! if (region->part_t_size != 1)
! LOCK_REGION_LOCK(env);
__env_alloc_free(<->reginfo,
SH_DBT_PTR(&sh_obj->lockobj));
! if (region->part_t_size != 1)
! LOCK_REGION_UNLOCK(env);
}
SH_TAILQ_INSERT_HEAD(
&FREE_OBJS(lt, part_id), sh_obj, links, __db_lockobj);
***************
*** 1470,1484 ****
if (obj->size <= sizeof(sh_obj->objdata))
p = sh_obj->objdata;
else {
! LOCK_REGION_LOCK(env);
if ((ret =
__env_alloc(<->reginfo, obj->size, &p)) != 0) {
__db_errx(env,
"No space for lock object storage");
! LOCK_REGION_UNLOCK(env);
goto err;
}
! LOCK_REGION_UNLOCK(env);
}
memcpy(p, obj->data, obj->size);
--- 1472,1492 ----
if (obj->size <= sizeof(sh_obj->objdata))
p = sh_obj->objdata;
else {
! /*
! * If we have only one partition, the region is locked.
! */
! if (region->part_t_size != 1)
! LOCK_REGION_LOCK(env);
if ((ret =
__env_alloc(<->reginfo, obj->size, &p)) != 0) {
__db_errx(env,
"No space for lock object storage");
! if (region->part_t_size != 1)
! LOCK_REGION_UNLOCK(env);
goto err;
}
! if (region->part_t_size != 1)
! LOCK_REGION_UNLOCK(env);
}
memcpy(p, obj->data, obj->size);
--- NEW FILE patch.4.7.25.3 ---
*** lock/lock_deadlock.c 2008-03-11 00:31:33.000000000 +1100
--- lock/lock_deadlock.c 2008-12-16 21:54:18.000000000 +1100
***************
*** 121,127 ****
DB_LOCKTAB *lt;
db_timespec now;
locker_info *idmap;
! u_int32_t *bitmap, *copymap, **deadp, **free_me, *tmpmap;
u_int32_t i, cid, keeper, killid, limit, nalloc, nlockers;
u_int32_t lock_max, txn_max;
int ret, status;
--- 121,127 ----
DB_LOCKTAB *lt;
db_timespec now;
locker_info *idmap;
! u_int32_t *bitmap, *copymap, **deadp, **deadlist, *tmpmap;
u_int32_t i, cid, keeper, killid, limit, nalloc, nlockers;
u_int32_t lock_max, txn_max;
int ret, status;
***************
*** 133,139 ****
if (IS_REP_CLIENT(env))
atype = DB_LOCK_MINWRITE;
! free_me = NULL;
lt = env->lk_handle;
if (rejectp != NULL)
--- 133,140 ----
if (IS_REP_CLIENT(env))
atype = DB_LOCK_MINWRITE;
! copymap = tmpmap = NULL;
! deadlist = NULL;
lt = env->lk_handle;
if (rejectp != NULL)
***************
*** 179,189 ****
memcpy(copymap, bitmap, nlockers * sizeof(u_int32_t) * nalloc);
if ((ret = __os_calloc(env, sizeof(u_int32_t), nalloc, &tmpmap)) != 0)
! goto err1;
/* Find a deadlock. */
if ((ret =
! __dd_find(env, bitmap, idmap, nlockers, nalloc, &deadp)) != 0)
return (ret);
/*
--- 180,190 ----
memcpy(copymap, bitmap, nlockers * sizeof(u_int32_t) * nalloc);
if ((ret = __os_calloc(env, sizeof(u_int32_t), nalloc, &tmpmap)) != 0)
! goto err;
/* Find a deadlock. */
if ((ret =
! __dd_find(env, bitmap, idmap, nlockers, nalloc, &deadlist)) != 0)
return (ret);
/*
***************
*** 204,211 ****
txn_max = TXN_MAXIMUM;
killid = BAD_KILLID;
! free_me = deadp;
! for (; *deadp != NULL; deadp++) {
if (rejectp != NULL)
++*rejectp;
killid = (u_int32_t)(*deadp - bitmap) / nalloc;
--- 205,211 ----
txn_max = TXN_MAXIMUM;
killid = BAD_KILLID;
! for (deadp = deadlist; *deadp != NULL; deadp++) {
if (rejectp != NULL)
++*rejectp;
killid = (u_int32_t)(*deadp - bitmap) / nalloc;
***************
*** 342,352 ****
__db_msg(env,
"Aborting locker %lx", (u_long)idmap[killid].id);
}
! __os_free(env, tmpmap);
! err1: __os_free(env, copymap);
!
! err: if (free_me != NULL)
! __os_free(env, free_me);
__os_free(env, bitmap);
__os_free(env, idmap);
--- 342,353 ----
__db_msg(env,
"Aborting locker %lx", (u_long)idmap[killid].id);
}
! err: if(copymap != NULL)
! __os_free(env, copymap);
! if (deadlist != NULL)
! __os_free(env, deadlist);
! if(tmpmap != NULL)
! __os_free(env, tmpmap);
__os_free(env, bitmap);
__os_free(env, idmap);
***************
*** 360,365 ****
--- 361,377 ----
#define DD_INVALID_ID ((u_int32_t) -1)
+ /*
+ * __dd_build --
+ * Build the lock dependency bit maps.
+ * Notes on syncronization:
+ * LOCK_SYSTEM_LOCK is used to hold objects locked when we have
+ * a single partition.
+ * LOCK_LOCKERS is held while we are walking the lockers list and
+ * to single thread the use of lockerp->dd_id.
+ * LOCK_DD protects the DD list of objects.
+ */
+
static int
__dd_build(env, atype, bmp, nlockers, allocp, idmap, rejectp)
ENV *env;
***************
*** 393,398 ****
--- 405,411 ----
* In particular we do not build the conflict array and our caller
* needs to expect this.
*/
+ LOCK_SYSTEM_LOCK(lt, region);
if (atype == DB_LOCK_EXPIRE) {
skip: LOCK_DD(env, region);
op = SH_TAILQ_FIRST(®ion->dd_objs, __db_lockobj);
***************
*** 430,446 ****
OBJECT_UNLOCK(lt, region, indx);
}
UNLOCK_DD(env, region);
goto done;
}
/*
! * We'll check how many lockers there are, add a few more in for
! * good measure and then allocate all the structures. Then we'll
! * verify that we have enough room when we go back in and get the
! * mutex the second time.
*/
! retry: count = region->stat.st_nlockers;
if (count == 0) {
*nlockers = 0;
return (0);
}
--- 443,460 ----
OBJECT_UNLOCK(lt, region, indx);
}
UNLOCK_DD(env, region);
+ LOCK_SYSTEM_UNLOCK(lt, region);
goto done;
}
/*
! * Allocate after locking the region
! * to make sure the structures are large enough.
*/
! LOCK_LOCKERS(env, region);
! count = region->stat.st_nlockers;
if (count == 0) {
+ UNLOCK_LOCKERS(env, region);
*nlockers = 0;
return (0);
}
***************
*** 448,497 ****
if (FLD_ISSET(env->dbenv->verbose, DB_VERB_DEADLOCK))
__db_msg(env, "%lu lockers", (u_long)count);
- count += 20;
nentries = (u_int32_t)DB_ALIGN(count, 32) / 32;
! /*
! * Allocate enough space for a count by count bitmap matrix.
! *
! * XXX
! * We can probably save the malloc's between iterations just
! * reallocing if necessary because count grew by too much.
! */
if ((ret = __os_calloc(env, (size_t)count,
! sizeof(u_int32_t) * nentries, &bitmap)) != 0)
return (ret);
if ((ret = __os_calloc(env,
sizeof(u_int32_t), nentries, &tmpmap)) != 0) {
__os_free(env, bitmap);
return (ret);
}
if ((ret = __os_calloc(env,
(size_t)count, sizeof(locker_info), &id_array)) != 0) {
__os_free(env, bitmap);
__os_free(env, tmpmap);
return (ret);
}
/*
- * Now go back in and actually fill in the matrix.
- */
- if (region->stat.st_nlockers > count) {
- __os_free(env, bitmap);
- __os_free(env, tmpmap);
- __os_free(env, id_array);
- goto retry;
- }
-
- /*
* First we go through and assign each locker a deadlock detector id.
*/
id = 0;
- LOCK_LOCKERS(env, region);
SH_TAILQ_FOREACH(lip, ®ion->lockers, ulinks, __db_locker) {
if (lip->master_locker == INVALID_ROFF) {
lip->dd_id = id++;
id_array[lip->dd_id].id = lip->id;
switch (atype) {
--- 462,498 ----
if (FLD_ISSET(env->dbenv->verbose, DB_VERB_DEADLOCK))
__db_msg(env, "%lu lockers", (u_long)count);
nentries = (u_int32_t)DB_ALIGN(count, 32) / 32;
! /* Allocate enough space for a count by count bitmap matrix. */
if ((ret = __os_calloc(env, (size_t)count,
! sizeof(u_int32_t) * nentries, &bitmap)) != 0) {
! UNLOCK_LOCKERS(env, region);
return (ret);
+ }
if ((ret = __os_calloc(env,
sizeof(u_int32_t), nentries, &tmpmap)) != 0) {
+ UNLOCK_LOCKERS(env, region);
__os_free(env, bitmap);
return (ret);
}
if ((ret = __os_calloc(env,
(size_t)count, sizeof(locker_info), &id_array)) != 0) {
+ UNLOCK_LOCKERS(env, region);
__os_free(env, bitmap);
__os_free(env, tmpmap);
return (ret);
}
/*
* First we go through and assign each locker a deadlock detector id.
*/
id = 0;
SH_TAILQ_FOREACH(lip, ®ion->lockers, ulinks, __db_locker) {
if (lip->master_locker == INVALID_ROFF) {
+ DB_ASSERT(env, id < count);
lip->dd_id = id++;
id_array[lip->dd_id].id = lip->id;
switch (atype) {
***************
*** 510,516 ****
lip->dd_id = DD_INVALID_ID;
}
- UNLOCK_LOCKERS(env, region);
/*
* We only need consider objects that have waiters, so we use
--- 511,516 ----
***************
*** 669,675 ****
* status after building the bit maps so that we will not detect
* a blocked transaction without noting that it is already aborting.
*/
- LOCK_LOCKERS(env, region);
for (id = 0; id < count; id++) {
if (!id_array[id].valid)
continue;
--- 669,674 ----
***************
*** 738,743 ****
--- 737,743 ----
id_array[id].in_abort = 1;
}
UNLOCK_LOCKERS(env, region);
+ LOCK_SYSTEM_UNLOCK(lt, region);
/*
* Now we can release everything except the bitmap matrix that we
***************
*** 839,844 ****
--- 839,845 ----
ret = 0;
/* We must lock so this locker cannot go away while we abort it. */
+ LOCK_SYSTEM_LOCK(lt, region);
LOCK_LOCKERS(env, region);
/*
***************
*** 895,900 ****
--- 896,902 ----
done: OBJECT_UNLOCK(lt, region, info->last_ndx);
err:
out: UNLOCK_LOCKERS(env, region);
+ LOCK_SYSTEM_UNLOCK(lt, region);
return (ret);
}
Index: db4.spec
===================================================================
RCS file: /cvs/pkgs/rpms/db4/F-10/db4.spec,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- db4.spec 4 Dec 2008 11:41:43 -0000 1.65
+++ db4.spec 23 Dec 2008 17:01:26 -0000 1.66
@@ -5,23 +5,30 @@
Summary: The Berkeley DB database library (version 4) for C
Name: db4
Version: 4.7.25
-Release: 6%{?dist}
+Release: 7%{?dist}
Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
Source1: http://download.oracle.com/berkeley-db/db.1.85.tar.gz
-Patch1: http://www.oracle.com/technology/products/berkeley-db/db/update/4.7.25/patch.4.7.25.1
-Patch2: db-4.3.29-sparc64.patch
-Patch3: db-4.6.21-1.85-compat.patch
+# db-4.7.25 upstream patches
+Patch0: http://www.oracle.com/technology/products/berkeley-db/db/update/4.7.25/patch.4.7.25.1
+Patch1: http://www.oracle.com/technology/products/berkeley-db/db/update/4.7.25/patch.4.7.25.2
+Patch2: http://www.oracle.com/technology/products/berkeley-db/db/update/4.7.25/patch.4.7.25.3
+# db-1.85 upstream patches
Patch10: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.1
Patch11: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.2
Patch12: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.3
Patch13: http://www.oracle.com/technology/products/berkeley-db/db/update/1.85/patch.1.4
-Patch14: db-1.85-errno.patch
-Patch22: db-4.5.20-jni-include-dir.patch
+# other patches
+Patch20: db-1.85-errno.patch
+Patch21: db-4.3.29-sparc64.patch
+Patch22: db-4.6.21-1.85-compat.patch
+Patch23: db-4.5.20-jni-include-dir.patch
URL: http://www.oracle.com/database/berkeley-db/
License: BSD
Group: System Environment/Libraries
+# unversioned obsoletes are OK here as these BDB versions never occur again
Obsoletes: db1, db2, db3
-BuildRequires: perl, libtool, ed, tcl-devel >= 8.4.4, util-linux-ng
+BuildRequires: perl, libtool, ed, util-linux-ng
+BuildRequires: tcl-devel >= 8.4.4
%ifarch %{java_arches}
BuildRequires: gcc-java
BuildRequires: java-1.6.0-openjdk-devel
@@ -114,14 +121,10 @@
%prep
%setup -q -n db-%{version} -a 1
-%patch1 -p0 -b .sequence
-%patch2 -p1 -b .sparc64
-%patch3 -p1 -b .185compat
-
-pushd dist
-libtoolize --copy --force
-cat %{_datadir}/aclocal/libtool.m4 >> aclocal.m4
-popd
+%patch0 -p0 -b .sequence
+%patch1 -p0 -b .deadlock
+%patch2 -p0 -b .dd-segfaults
+
pushd db.1.85/PORT/linux
%patch10 -p0 -b .1.1
popd
@@ -129,10 +132,12 @@
%patch11 -p0 -b .1.2
%patch12 -p0 -b .1.3
%patch13 -p0 -b .1.4
-%patch14 -p1 -b .errno
+%patch20 -p1 -b .errno
popd
-%patch22 -p1 -b .4.5.20.jni
+%patch21 -p1 -b .sparc64
+%patch22 -p1 -b .185compat
+%patch23 -p1 -b .4.5.20.jni
# Remove tags files which we don't need.
find . -name tags | xargs rm -f
@@ -367,6 +372,14 @@
%endif
%changelog
+* Tue Dec 23 2008 Jindrich Novy <jnovy at redhat.com> 4.7.25-7
+- DB_ENV->lock_get may self deadlock if user defined locks
+ are used and there is only one lock partition defined
+ (upstream bz#16415)
+- fix for dd segfaults (upstream bz#16541)
+- reorder patches
+- nuke useless libtool hacks
+
* Thu Dec 4 2008 Jindrich Novy <jnovy at redhat.com> 4.7.25-6
- package complete db4 documentation in db4-devel (#471633)
- remove s390 and s390x from java_arches (#474061)
- Previous message (by thread): rpms/ruby-qpid/F-9 .cvsignore, 1.4, 1.5 ruby-qpid.spec, 1.3, 1.4 sources, 1.4, 1.5
- Next message (by thread): rpms/db4/F-9 patch.4.6.21.3,NONE,1.1 db4.spec,1.58,1.59
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list