rpms/gnome-keyring/devel gnome-keyring-2.21.5-race-condition.patch, NONE, 1.1 gnome-keyring.spec, 1.74, 1.75

Matthew Barnes (mbarnes) fedora-extras-commits at redhat.com
Mon Jan 21 20:15:31 UTC 2008


Author: mbarnes

Update of /cvs/pkgs/rpms/gnome-keyring/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5486

Modified Files:
	gnome-keyring.spec 
Added Files:
	gnome-keyring-2.21.5-race-condition.patch 
Log Message:

* Mon Jan 21 2008 Matthew Barnes  <mbarnes at redhat.com> - 2.21.5-2
- Fix a race condition that was causing Evolution to hang (#429097)


gnome-keyring-2.21.5-race-condition.patch:

--- NEW FILE gnome-keyring-2.21.5-race-condition.patch ---
diff -up gnome-keyring-2.21.5/common/gkr-async.c.race-condition gnome-keyring-2.21.5/common/gkr-async.c
--- gnome-keyring-2.21.5/common/gkr-async.c.race-condition	2008-01-11 10:48:00.000000000 -0500
+++ gnome-keyring-2.21.5/common/gkr-async.c	2008-01-21 15:09:51.000000000 -0500
@@ -34,6 +34,10 @@
 
 #define DEBUG_LOCKS 0
 
+/* 
+ * See comments on async_poll_func() on the order of the various
+ * gets and sets of waiting_on_* flags.
+ */
 #if DEBUG_LOCKS
 #define DO_LOCK(mtx) G_STMT_START { \
 		g_printerr ("%s LOCK %s\n", __func__, G_STRINGIFY(mtx));  \
@@ -93,8 +97,18 @@ async_poll_func (GPollFD *ufds, guint nf
 	gint ret;
 	
 	g_assert (orig_poll_func);
+
+	/* 
+	 * These two atomic variables are interlocked in the 
+	 * opposite order from those in DO_LOCK which prevents
+	 * race conditions in the if statements.
+	 */
 	g_atomic_int_set (&waiting_on_poll, 1);
+	if (g_atomic_int_get (&waiting_on_lock))
+		timeout = 0;
+
 	ret = (orig_poll_func) (ufds, nfsd, timeout);
+
 	g_atomic_int_set (&waiting_on_poll, 0);
 	
  	if (done_queue && !g_queue_is_empty (done_queue))
@@ -314,7 +328,6 @@ cleanup_done_thread (gpointer message, g
 		running_workers = NULL;
 		
 		g_assert (main_loop);
-		gkr_wakeup_register (g_main_loop_get_context (main_loop));
 		return FALSE;
 	}
 	
@@ -346,7 +359,6 @@ gkr_async_worker_start (GThreadFunc func
 	
 	if (!done_queue) {
 		g_assert (main_loop);
-		gkr_wakeup_register (g_main_loop_get_context (main_loop));
 		
 		done_queue = g_queue_new ();
 		g_assert (!running_workers);


Index: gnome-keyring.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-keyring/devel/gnome-keyring.spec,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- gnome-keyring.spec	15 Jan 2008 00:31:49 -0000	1.74
+++ gnome-keyring.spec	21 Jan 2008 20:14:42 -0000	1.75
@@ -30,6 +30,8 @@
 Requires(preun): GConf2
 Requires(post): GConf2
 
+# RH #429097 / GNOME #502603
+Patch0: gnome-keyring-2.21.5-race-condition.patch
 
 %description
 gnome-keyring manages passwords and other types of secrets
@@ -68,6 +70,7 @@
 
 %prep
 %setup -q -n gnome-keyring-%{version}
+%patch0 -p1 -b .race-condition
 
 %build
 aclocal
@@ -136,6 +139,9 @@
 
 
 %changelog
+* Mon Jan 21 2008 Matthew Barnes  <mbarnes at redhat.com> - 2.21.5-2
+- Fix a race condition that was causing Evolution to hang (#429097)
+
 * Mon Jan 14 2008 Matthias Clasen  <mclasen at redhat.com> - 2.21.5-1
 - Update to 2.21.5
 




More information about the fedora-extras-commits mailing list