[Pkg-utopia-commits] r3003 - in /packages/lenny/consolekit/debian: changelog patches/06-xmlto_skip_validation.patch patches/08-fix-double-close.patch patches/09-directory-handle-leak.patch patches/10-file_monitor_remove_watch_crash.patch patches/series

biebl at users.alioth.debian.org biebl at users.alioth.debian.org
Sun Mar 29 19:19:43 UTC 2009


Author: biebl
Date: Sun Mar 29 19:19:43 2009
New Revision: 3003

URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=3003
Log:
* debian/patches/06-xmlto_skip_validation.patch
  - Skip XML validation when generating the documentation. (Closes: #516253)
    The xmlto version in lenny otherwise causes a FTBFS.
* debian/patches/08-fix-double-close.patch
  - Fix double close of the log file, which occasionally causes segfaults.
* debian/patches/09-directory-handle-leak.patch
  - Close the directory handle when we're done with it, so that we aren't
    leaking file descriptors.
* debian/patches/10-file_monitor_remove_watch_crash.patch
  - Fix common crash when trying to remove a NULL watch.

Added:
    packages/lenny/consolekit/debian/patches/06-xmlto_skip_validation.patch
    packages/lenny/consolekit/debian/patches/08-fix-double-close.patch
    packages/lenny/consolekit/debian/patches/09-directory-handle-leak.patch
    packages/lenny/consolekit/debian/patches/10-file_monitor_remove_watch_crash.patch
Modified:
    packages/lenny/consolekit/debian/changelog
    packages/lenny/consolekit/debian/patches/series

Modified: packages/lenny/consolekit/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/lenny/consolekit/debian/changelog?rev=3003&op=diff
==============================================================================
--- packages/lenny/consolekit/debian/changelog (original)
+++ packages/lenny/consolekit/debian/changelog Sun Mar 29 19:19:43 2009
@@ -3,8 +3,18 @@
   * debian/patches/11-unref-dbus-proxy.patch
     - Unref the dbus proxy when finalizing the session object, so that
       they are not leaked. (Closes: #521651)
+  * debian/patches/06-xmlto_skip_validation.patch
+    - Skip XML validation when generating the documentation. (Closes: #516253)
+      The xmlto version in lenny otherwise causes a FTBFS.
+  * debian/patches/08-fix-double-close.patch
+    - Fix double close of the log file, which occasionally causes segfaults.
+  * debian/patches/09-directory-handle-leak.patch
+    - Close the directory handle when we're done with it, so that we aren't
+      leaking file descriptors.
+  * debian/patches/10-file_monitor_remove_watch_crash.patch
+    - Fix common crash when trying to remove a NULL watch.
 
- -- Michael Biebl <biebl at debian.org>  Sun, 29 Mar 2009 17:50:57 +0200
+ -- Michael Biebl <biebl at debian.org>  Sun, 29 Mar 2009 21:13:21 +0200
 
 consolekit (0.2.10-5) unstable; urgency=high
 

Added: packages/lenny/consolekit/debian/patches/06-xmlto_skip_validation.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/lenny/consolekit/debian/patches/06-xmlto_skip_validation.patch?rev=3003&op=file
==============================================================================
--- packages/lenny/consolekit/debian/patches/06-xmlto_skip_validation.patch (added)
+++ packages/lenny/consolekit/debian/patches/06-xmlto_skip_validation.patch Sun Mar 29 19:19:43 2009
@@ -1,0 +1,26 @@
+Index: consolekit-0.2.10/doc/Makefile.am
+===================================================================
+--- consolekit-0.2.10.orig/doc/Makefile.am	2009-03-29 18:17:23.000000000 +0200
++++ consolekit-0.2.10/doc/Makefile.am	2009-03-29 18:19:06.000000000 +0200
+@@ -16,7 +16,7 @@
+ htmldoc_DATA = ConsoleKit.html
+ 
+ ConsoleKit.html : $(SPEC_XML_FILES)
+-	$(XMLTO) xhtml-nochunks -m config.xsl ConsoleKit.xml
++	$(XMLTO) --skip-validation xhtml-nochunks -m config.xsl ConsoleKit.xml
+ 
+ endif # DOCBOOK_DOCS_ENABLED
+ 
+Index: consolekit-0.2.10/doc/Makefile.in
+===================================================================
+--- consolekit-0.2.10.orig/doc/Makefile.in	2009-03-29 18:17:13.000000000 +0200
++++ consolekit-0.2.10/doc/Makefile.in	2009-03-29 18:19:17.000000000 +0200
+@@ -421,7 +421,7 @@
+ 
+ 
+ @DOCBOOK_DOCS_ENABLED_TRUE at ConsoleKit.html : $(SPEC_XML_FILES)
+- at DOCBOOK_DOCS_ENABLED_TRUE@	$(XMLTO) xhtml-nochunks -m config.xsl ConsoleKit.xml
++ at DOCBOOK_DOCS_ENABLED_TRUE@	$(XMLTO) --skip-validation xhtml-nochunks -m config.xsl ConsoleKit.xml
+ 	$(NULL)
+ 
+ clean-local:

Added: packages/lenny/consolekit/debian/patches/08-fix-double-close.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/lenny/consolekit/debian/patches/08-fix-double-close.patch?rev=3003&op=file
==============================================================================
--- packages/lenny/consolekit/debian/patches/08-fix-double-close.patch (added)
+++ packages/lenny/consolekit/debian/patches/08-fix-double-close.patch Sun Mar 29 19:19:43 2009
@@ -1,0 +1,31 @@
+# Description: Fix double close of the log file (->file is an fdopen(->priv), which occasionally causes segfaults.
+# Ubuntu: https://bugs.launchpad.net/bugs/263245
+# Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=17866
+# Upstream: http://gitweb.freedesktop.org/?p=ConsoleKit.git;a=commitdiff;h=a58a4bff451dcf8a6019aed1b2fb276e9836b0f4
+--- a/src/ck-event-logger.c
++++ b/src/ck-event-logger.c
+@@ -180,8 +180,10 @@ retry:
+ static void
+ reopen_file_stream (CkEventLogger *event_logger)
+ {
+-        close (event_logger->priv->fd);
+-        fclose (event_logger->priv->file);
++        /* fclose will also close the underlying fd */
++        if (event_logger->priv->file != NULL) {
++                fclose (event_logger->priv->file);
++        }
+ 
+         /* FIXME: retries */
+         open_log_file (event_logger);
+@@ -420,8 +422,8 @@ ck_event_logger_finalize (GObject *objec
+                 g_async_queue_unref (event_logger->priv->event_queue);
+         }
+ 
+-        if (event_logger->priv->fd != -1) {
+-                close (event_logger->priv->fd);
++        if (event_logger->priv->file != NULL) {
++                fclose (event_logger->priv->file);
+         }
+ 
+         g_free (event_logger->priv->log_filename);
+

Added: packages/lenny/consolekit/debian/patches/09-directory-handle-leak.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/lenny/consolekit/debian/patches/09-directory-handle-leak.patch?rev=3003&op=file
==============================================================================
--- packages/lenny/consolekit/debian/patches/09-directory-handle-leak.patch (added)
+++ packages/lenny/consolekit/debian/patches/09-directory-handle-leak.patch Sun Mar 29 19:19:43 2009
@@ -1,0 +1,15 @@
+# Description: Close the directory handle when we're done with it, so that we aren't leaking file descriptors.
+# Ubuntu: https://launchpad.net/bugs/276918
+# Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=17893
+Index: consolekit-0.2.10/src/ck-run-programs.c
+===================================================================
+--- consolekit-0.2.10.orig/src/ck-run-programs.c
++++ consolekit-0.2.10/src/ck-run-programs.c
+@@ -225,6 +225,7 @@
+         out_loop:
+                 g_free (child_argv[0]);
+         }
++        g_dir_close (dir);
+ out:
+         g_strfreev (env_for_child);
+ }

Added: packages/lenny/consolekit/debian/patches/10-file_monitor_remove_watch_crash.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/lenny/consolekit/debian/patches/10-file_monitor_remove_watch_crash.patch?rev=3003&op=file
==============================================================================
--- packages/lenny/consolekit/debian/patches/10-file_monitor_remove_watch_crash.patch (added)
+++ packages/lenny/consolekit/debian/patches/10-file_monitor_remove_watch_crash.patch Sun Mar 29 19:19:43 2009
@@ -1,0 +1,249 @@
+# Description: Fix common crash when trying to remove a NULL watch
+# Ubuntu: https://launchpad.net/bugs/269651
+# Upstream: http://bugs.freedesktop.org/show_bug.cgi?id=18046
+Index: consolekit-0.2.10/src/ck-file-monitor-inotify.c
+===================================================================
+--- consolekit-0.2.10.orig/src/ck-file-monitor-inotify.c	2008-10-20 14:41:37.000000000 +0100
++++ consolekit-0.2.10/src/ck-file-monitor-inotify.c	2008-10-20 14:56:02.000000000 +0100
+@@ -55,7 +55,7 @@
+ 
+ typedef struct
+ {
+-        FileInotifyWatch  *watch;
++        gint               wd;
+         CkFileMonitorEvent event;
+         char              *path;
+ } FileMonitorEventInfo;
+@@ -80,7 +80,9 @@
+         guchar     *buffer;
+ 
+         guint       events_idle_id;
++        guint       remove_idle_id;
+         GQueue     *notify_events;
++        GQueue     *remove_events;
+ };
+ 
+ enum {
+@@ -242,6 +244,10 @@
+ file_monitor_remove_watch (CkFileMonitor    *monitor,
+                            FileInotifyWatch *watch)
+ {
++        if (watch->wd == -1) {
++                return;
++        }
++
+         g_hash_table_remove (monitor->priv->path_to_watch,
+                              watch->path);
+         g_hash_table_remove (monitor->priv->wd_to_watch,
+@@ -296,6 +302,7 @@
+ emit_events_in_idle (CkFileMonitor *monitor)
+ {
+         FileMonitorEventInfo *event_info;
++        gchar                *path, *freeme;
+ 
+         monitor->priv->events_idle_id = 0;
+ 
+@@ -303,29 +310,39 @@
+                 GSList           *l;
+                 FileInotifyWatch *watch;
+ 
+-                watch = event_info->watch;
+-
+-                for (l = watch->notifies; l != NULL; l = l->next) {
+-                        FileMonitorNotify *notify;
++                watch = g_hash_table_lookup (monitor->priv->wd_to_watch,
++                                             GINT_TO_POINTER (event_info->wd));
+ 
+-                        notify = g_hash_table_lookup (monitor->priv->notifies,
+-                                                      GUINT_TO_POINTER (l->data));
+-                        if (notify == NULL) {
+-                                continue;
+-                        }
+-
+-                        if (! (notify->mask & event_info->event)) {
+-                                continue;
+-                        }
+-
+-                        if (notify->notify_func) {
+-                                notify->notify_func (monitor, event_info->event, event_info->path, notify->user_data);
+-                        }
++                if (watch) {
++                    for (l = watch->notifies; l != NULL; l = l->next) {
++                            FileMonitorNotify *notify;
++
++                            notify = g_hash_table_lookup (monitor->priv->notifies,
++                                                          GUINT_TO_POINTER (l->data));
++                            if (notify == NULL) {
++                                    continue;
++                            }
++
++                            if (! (notify->mask & event_info->event)) {
++                                    continue;
++                            }
++
++                            if (notify->notify_func) {
++                                    freeme = NULL;
++                                    if (event_info->path) {
++                                            path = freeme = g_build_filename (watch->path, event_info->path, NULL);
++                                    } else {
++                                            path = watch->path;
++                                    }
++                                    notify->notify_func (monitor, event_info->event, path, notify->user_data);
++                                    if (freeme) {
++                                        g_free (freeme);
++                                    }
++                            }
++                    }
+                 }
+ 
+-                g_free (event_info->path);
+                 event_info->path = NULL;
+-
+                 event_info->event = CK_FILE_MONITOR_EVENT_NONE;
+ 
+                 g_free (event_info);
+@@ -334,6 +351,37 @@
+         return FALSE;
+ }
+ 
++static gboolean
++emit_removals_in_idle (CkFileMonitor *monitor)
++{
++        gint              wd;
++        FileInotifyWatch *watch;
++        GSList           *l;
++
++        monitor->priv->remove_idle_id = 0;
++
++        while ((wd = g_queue_pop_head (monitor->priv->remove_events)) != NULL) {
++                watch = g_hash_table_lookup (monitor->priv->wd_to_watch,
++                        GINT_TO_POINTER (wd));
++                if (watch && watch->wd != -1) {
++                    for (l = watch->notifies; l != NULL; l = l->next) {
++                            FileMonitorNotify *notify;
++
++                            notify = g_hash_table_lookup (monitor->priv->notifies,
++                                                          GUINT_TO_POINTER (l->data));
++                            if (notify == NULL) {
++                                    continue;
++                            }
++                            notify->watch = NULL;
++                    }
++                    file_monitor_remove_watch (monitor, watch);
++                    g_free (watch);
++                }
++        }
++
++        return FALSE;
++}
++
+ static void
+ file_monitor_queue_event (CkFileMonitor        *monitor,
+                           FileMonitorEventInfo *event_info)
+@@ -347,7 +395,7 @@
+ 
+ static void
+ queue_watch_event (CkFileMonitor     *monitor,
+-                   FileInotifyWatch  *watch,
++                   gint               wd,
+                    CkFileMonitorEvent event,
+                    const char        *path)
+ {
+@@ -355,7 +403,7 @@
+ 
+         event_info = g_new0 (FileMonitorEventInfo, 1);
+ 
+-        event_info->watch   = watch;
++        event_info->wd      = wd;
+         event_info->path    = g_strdup (path);
+         event_info->event   = event;
+ 
+@@ -363,8 +411,18 @@
+ }
+ 
+ static void
++queue_remove_event (CkFileMonitor *monitor,
++                    gint           wd)
++{
++        g_queue_push_tail (monitor->priv->remove_events, wd);
++
++        if (monitor->priv->remove_idle_id == 0) {
++                monitor->priv->remove_idle_id = g_idle_add ((GSourceFunc) emit_removals_in_idle, monitor);
++        }
++}
++
++static void
+ handle_inotify_event (CkFileMonitor        *monitor,
+-                      FileInotifyWatch     *watch,
+                       struct inotify_event *ievent)
+ {
+         CkFileMonitorEvent  event;
+@@ -375,9 +433,9 @@
+         freeme = NULL;
+ 
+         if (ievent->len > 0) {
+-                path = freeme = g_build_filename (watch->path, ievent->name, NULL);
++                path = ievent->name;
+         } else {
+-                path = watch->path;
++                path = NULL;
+         }
+ 
+         mask_str = imask_to_string (ievent->mask);
+@@ -397,11 +455,11 @@
+         }
+ 
+         if (event != CK_FILE_MONITOR_EVENT_NONE) {
+-                queue_watch_event (monitor, watch, event, path);
++                queue_watch_event (monitor, ievent->wd, event, path);
+         }
+ 
+         if (ievent->mask & IN_IGNORED) {
+-                file_monitor_remove_watch (monitor, watch);
++                queue_remove_event (monitor, ievent->wd);
+         }
+ }
+ 
+@@ -460,7 +518,7 @@
+                 watch = g_hash_table_lookup (monitor->priv->wd_to_watch,
+                                              GINT_TO_POINTER (ievent->wd));
+                 if (watch != NULL) {
+-                        handle_inotify_event (monitor, watch, ievent);
++                        handle_inotify_event (monitor, ievent);
+                 }
+ 
+                 i += sizeof (struct inotify_event) + ievent->len;
+@@ -523,11 +581,13 @@
+         g_hash_table_steal (monitor->priv->notifies,
+                             GUINT_TO_POINTER (id));
+ 
+-        notify->watch->notifies = g_slist_remove (notify->watch->notifies, GUINT_TO_POINTER (id));
++        if (notify->watch) {
++            notify->watch->notifies = g_slist_remove (notify->watch->notifies, GUINT_TO_POINTER (id));
+ 
+-        if (g_slist_length (notify->watch->notifies) == 0) {
+-                file_monitor_remove_watch (monitor, notify->watch);
+-                g_free (notify->watch);
++            if (g_slist_length (notify->watch->notifies) == 0) {
++                    file_monitor_remove_watch (monitor, notify->watch);
++                    g_free (notify->watch);
++            }
+         }
+ 
+         g_free (notify);
+@@ -629,6 +689,7 @@
+ 
+         monitor->priv->serial = 1;
+         monitor->priv->notify_events = g_queue_new ();
++        monitor->priv->remove_events = g_queue_new ();
+ 
+         setup_inotify (monitor);
+ }
+@@ -649,6 +710,7 @@
+ 
+         g_hash_table_destroy (monitor->priv->notifies);
+         g_queue_free (monitor->priv->notify_events);
++        g_queue_free (monitor->priv->remove_events);
+ 
+         G_OBJECT_CLASS (ck_file_monitor_parent_class)->finalize (object);
+ }

Modified: packages/lenny/consolekit/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/lenny/consolekit/debian/patches/series?rev=3003&op=diff
==============================================================================
--- packages/lenny/consolekit/debian/patches/series (original)
+++ packages/lenny/consolekit/debian/patches/series Sun Mar 29 19:19:43 2009
@@ -3,4 +3,8 @@
 03-cleanup_console_tags.patch
 04-defer_daemonizing.patch
 05-dbus_policy.patch
+06-xmlto_skip_validation.patch
+08-fix-double-close.patch
+09-directory-handle-leak.patch
+10-file_monitor_remove_watch_crash.patch
 11-unref-dbus-proxy.patch




More information about the Pkg-utopia-commits mailing list