Package: libglib2.0-cil
Severity: serious

[this is a shortened version of my original report that was eaten by
reportbug which deserves a critical bugreport for the data loss]

Since a change in glib warnings are printed to STDERR for /each/
g_source_remove call if the item wasn't in the list. This can lead to
serious hardware resource usage (see below), thus severity set to
serious.

Example of such message:
 (smuxi-frontend-gnome:4942): GLib-CRITICAL **: Source ID 3462469 was
not found when attempting to remove it

meebey@redhorse:~$ ls -lh ~/.cache/gdm/session.log
-rw------- 1 meebey meebey 130M 2015-01-24 12:16
/home/meebey/.cache/gdm/session.log
meebey@redhorse:~$ grep -c -F 'GLib-CRITICAL **: Source ID'
/home/meebey/.cache/gdm/session.log
1194536

-- 
Best regards,

Mirco 'meebey' Bauer

FOSS Developer          mee...@meebey.net  https://www.meebey.net/
Debian Developer        mee...@debian.org  http://www.debian.org/
GNOME Foundation Member mmmba...@gnome.org http://www.gnome.org/
PGP-Key ID              0xEEF946C8         https://meebey.net/pubkey.asc
commit 3a01260d87c738361f1b72673f73135b4d7545e7
Author: Bertrand Lorentz <bertrand.lore...@gmail.com>
Date:   Sat Jul 5 15:52:56 2014 +0200

    glib: Fix native GLib warnings when disposing SourceProxy objects
    
    When an instance of SourceProxy was finalized, we would try to remove
    the corresponding source, even if it was already removed. This now
    causes native GLib to print out warnings because it can't find the
    source ID.
    
    Now Source.Remove only calls g_source_remove if we really had a handler
    registered for the ID we're removing.

diff --git a/glib/Source.cs b/glib/Source.cs
index b62c3c5..89e691f 100644
--- a/glib/Source.cs
+++ b/glib/Source.cs
@@ -54,9 +54,15 @@ namespace GLib {
 
 		public static bool Remove (uint tag)
 		{
-			lock (Source.source_handlers)
-				source_handlers.Remove (tag);
-			return g_source_remove (tag);
+			// g_source_remove always returns true, so we follow that
+			bool ret = true;
+
+			lock (Source.source_handlers) {
+				if (source_handlers.Remove (tag)) {
+					ret = g_source_remove (tag);
+				}
+			}
+			return ret;
 		}
 	}
 }
commit 9c78f7019c8622a3fc7a10c3d3dc8dcb5f44a289
Author: Cody Russell <c...@jhu.edu>
Date:   Fri Jul 11 09:51:53 2014 -0500

    Check that source_handlers contains the tag.

diff --git a/glib/Source.cs b/glib/Source.cs
index 89e691f..cf9f4ba 100644
--- a/glib/Source.cs
+++ b/glib/Source.cs
@@ -58,7 +58,8 @@ namespace GLib {
 			bool ret = true;
 
 			lock (Source.source_handlers) {
-				if (source_handlers.Remove (tag)) {
+				if (source_handlers.Contains (tag)) {
+					source_handlers.Remove (tag);
 					ret = g_source_remove (tag);
 				}
 			}

Reply via email to