[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

upcoming upload of collectd 4.10.1-2



Hi,

I've prepared an updated package for collectd fixing the following
important or RC bugs:

 * #595756 (serious)
   notify_email: segfaults with slow mail server

 * #592623 (important)
   curl_json cannot access local files (with file:/// prefix url)

 * #596128 (important)
   collectd: incorrect heap implementation could lead to wrong plugin
   execution

Also, since I've had that in the queue before the freeze (and there was
no reason to upload so far), the proposed upload includes a fix for
#592909 (collectd: please add new Debian arch: powerpcspe) which is a
trivial fix to support the architecture "powerpcspe" and which I did not
throw out because it does not affect anything else.

Now, after finishing the package, I realized that it can no longer
transition from unstable to testing because of a SONAME version bump of
libesmtp (a dependency) in unstable (see also [1]) :-/

Is it fine for you that I upload the package to t-p-u, even though it
contains fixes for non-RC bugs as well or would you rather like me to
revert those changes? The fixes for the non-RC bugs are all rather
small.

Changes:
 collectd (4.10.1-2) testing-proposed-updates; urgency=medium
 .
   * debian/rules:
     - Added support for ‘powerpcspe’ to the Java arch mapping; thanks to
       Sebastian Andrzej Siewior for the patch (Closes: #592909).
   * debian/patches:
     - Added bts595756-notify_email-segfault -- upstream patch fixing a
       segfault in the 'notify_email' plugin; thanks to Manuel CISSE for
       reporting this (Closes: #595756).
     - Added bts592623-curl_json-file -- upstream patch fixing access to
       file:// URLs in the 'curl_json' plugin; thanks Baptiste Mille-Mathias
       for reporting this and pointing out the patch (Closes: #592623).
     - Added bts596128-reheap-fix -- upstream patch fixing the 'reheap()'
       function used to manage the "read" callbacks and making sure all plugins
       get executed correctly and in each interval (Closes: #596128).
   * Set urgency to "medium" because of the RC bug-fix.

Full debdiff to the latest version in Squeeze attached.

TIA,
Sebastian

[1] <http://lists.debian.org/debian-release/2010/09/msg00794.html>

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

debdiff collectd_4.10.1-1_amd64.deb collectd_4.10.1-2_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Version: [-4.10.1-1-] {+4.10.1-2+}


debdiff collectd-core_4.10.1-1_amd64.deb collectd-core_4.10.1-2_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Version: [-4.10.1-1-] {+4.10.1-2+}


debdiff collectd-dbg_4.10.1-1_amd64.deb collectd-dbg_4.10.1-2_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Depends: collectd-core (= [-4.10.1-1)-] {+4.10.1-2)+}
Recommends: collectd-utils (= [-4.10.1-1),-] {+4.10.1-2),+} libcollectdclient0 (= [-4.10.1-1)-] {+4.10.1-2)+}
Version: [-4.10.1-1-] {+4.10.1-2+}


debdiff collectd-dev_4.10.1-1_all.deb collectd-dev_4.10.1-2_all.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Depends: collectd-core (>= [-4.10.1-1),-] {+4.10.1-2),+} collectd-core (<< 4.11~)
Version: [-4.10.1-1-] {+4.10.1-2+}


debdiff collectd-utils_4.10.1-1_amd64.deb collectd-utils_4.10.1-2_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Version: [-4.10.1-1-] {+4.10.1-2+}


debdiff libcollectdclient0_4.10.1-1_amd64.deb libcollectdclient0_4.10.1-2_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Version: [-4.10.1-1-] {+4.10.1-2+}


debdiff libcollectdclient-dev_4.10.1-1_amd64.deb libcollectdclient-dev_4.10.1-2_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Depends: libcollectdclient0 (= [-4.10.1-1)-] {+4.10.1-2)+}
Version: [-4.10.1-1-] {+4.10.1-2+}


debdiff collectd_4.10.1-1.dsc collectd_4.10.1-2.dsc
diff -u collectd-4.10.1/debian/rules collectd-4.10.1/debian/rules
--- collectd-4.10.1/debian/rules
+++ collectd-4.10.1/debian/rules
@@ -33,7 +33,7 @@
 endif
 
 # The archdir map has been copied from openjdk-6's debian/rules.
-JAVA_ARCHDIR_MAP = armel=arm hppa=parisc lpia=i386 powerpc=ppc sh4=sh
+JAVA_ARCHDIR_MAP = armel=arm hppa=parisc lpia=i386 powerpc=ppc powerpcspe=ppc sh4=sh
 JAVA_ARCHDIR = $(strip $(patsubst $(DEB_BUILD_ARCH)=%, %, \
 			$(filter $(DEB_BUILD_ARCH)=%, $(JAVA_ARCHDIR_MAP))))
 ifeq (,$(JAVA_ARCHDIR))
diff -u collectd-4.10.1/debian/changelog collectd-4.10.1/debian/changelog
--- collectd-4.10.1/debian/changelog
+++ collectd-4.10.1/debian/changelog
@@ -1,3 +1,22 @@
+collectd (4.10.1-2) testing-proposed-updates; urgency=medium
+
+  * debian/rules:
+    - Added support for ‘powerpcspe’ to the Java arch mapping; thanks to
+      Sebastian Andrzej Siewior for the patch (Closes: #592909).
+  * debian/patches:
+    - Added bts595756-notify_email-segfault -- upstream patch fixing a
+      segfault in the 'notify_email' plugin; thanks to Manuel CISSE for
+      reporting this (Closes: #595756).
+    - Added bts592623-curl_json-file -- upstream patch fixing access to
+      file:// URLs in the 'curl_json' plugin; thanks Baptiste Mille-Mathias
+      for reporting this and pointing out the patch (Closes: #592623).
+    - Added bts596128-reheap-fix -- upstream patch fixing the 'reheap()'
+      function used to manage the "read" callbacks and making sure all plugins
+      get executed correctly and in each interval (Closes: #596128).
+  * Set urgency to "medium" because of the RC bug-fix.
+
+ -- Sebastian Harl <tokkee@debian.org>  Fri, 10 Sep 2010 18:35:06 +0200
+
 collectd (4.10.1-1) unstable; urgency=low
 
   * New upstream release.
diff -u collectd-4.10.1/debian/patches/00list collectd-4.10.1/debian/patches/00list
--- collectd-4.10.1/debian/patches/00list
+++ collectd-4.10.1/debian/patches/00list
@@ -3,2 +3,5 @@
 bts559801_plugin_find_fix.dpatch
+bts595756-notify_email-segfault.dpatch
+bts592623-curl_json-file.dpatch
+bts596128-reheap-fix.dpatch
 
only in patch2:
unchanged:
--- collectd-4.10.1.orig/debian/patches/bts595756-notify_email-segfault.dpatch
+++ collectd-4.10.1/debian/patches/bts595756-notify_email-segfault.dpatch
@@ -0,0 +1,140 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts595756-notify_email-segfault.dpatch
+## by Florian Forster <octo@verplant.org>
+##
+## DP: notify_email plugin: Serialize all accesses to libesmtp using a mutex.
+## DP:
+## DP: libesmtp is not thread-safe. This fixes segfaults when accessing the
+## DP: plugin in parallel.
+
+@DPATCH@
+
+diff a/src/notify_email.c b/src/notify_email.c
+--- a/src/notify_email.c
++++ b/src/notify_email.c
+@@ -1,6 +1,7 @@
+ /**
+  * collectd - src/notify_email.c
+  * Copyright (C) 2008  Oleg King
++ * Copyright (C) 2010  Florian Forster
+  *
+  * This program is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU General Public License as published by the
+@@ -18,6 +19,7 @@
+  *
+  * Authors:
+  *   Oleg King <king2 at kaluga.ru>
++ *   Florian Forster <octo at collectd.org>
+  **/
+ 
+ #include "collectd.h"
+@@ -26,6 +28,7 @@
+ 
+ #include <auth-client.h>
+ #include <libesmtp.h>
++#include <pthread.h>
+ 
+ #define MAXSTRING               256
+ 
+@@ -45,6 +48,7 @@ static char **recipients;
+ static int recipients_len = 0;
+ 
+ static smtp_session_t session;
++static pthread_mutex_t session_lock = PTHREAD_MUTEX_INITIALIZER;
+ static smtp_message_t message;
+ static auth_context_t authctx = NULL;
+ 
+@@ -113,17 +117,23 @@ static int notify_email_init (void)
+ {
+   char server[MAXSTRING];
+ 
++  ssnprintf(server, sizeof (server), "%s:%i",
++      (smtp_host == NULL) ? DEFAULT_SMTP_HOST : smtp_host,
++      smtp_port);
++
++  pthread_mutex_lock (&session_lock);
++
+   auth_client_init();
+-  if (!(session = smtp_create_session ())) {
++
++  session = smtp_create_session ();
++  if (session == NULL) {
++    pthread_mutex_unlock (&session_lock);
+     ERROR ("notify_email plugin: cannot create SMTP session");
+     return (-1);
+   }
+ 
+   smtp_set_monitorcb (session, monitor_cb, NULL, 1);
+   smtp_set_hostname (session, hostname_g);
+-  ssnprintf(server, sizeof (server), "%s:%i",
+-      (smtp_host == NULL) ? DEFAULT_SMTP_HOST : smtp_host,
+-      smtp_port);
+   smtp_set_server (session, server);
+ 
+   if (smtp_user && smtp_password) {
+@@ -133,18 +143,30 @@ static int notify_email_init (void)
+   }
+ 
+   if ( !smtp_auth_set_context (session, authctx)) {
++    pthread_mutex_unlock (&session_lock);
+     ERROR ("notify_email plugin: cannot set SMTP auth context");
+     return (-1);   
+   }
+ 
++  pthread_mutex_unlock (&session_lock);
+   return (0);
+ } /* int notify_email_init */
+ 
+ static int notify_email_shutdown (void)
+ {
+-  smtp_destroy_session (session);
+-  auth_destroy_context (authctx);
++  pthread_mutex_lock (&session_lock);
++
++  if (session != NULL)
++    smtp_destroy_session (session);
++  session = NULL;
++
++  if (authctx != NULL)
++    auth_destroy_context (authctx);
++  authctx = NULL;
++
+   auth_client_exit();
++
++  pthread_mutex_unlock (&session_lock);
+   return (0);
+ } /* int notify_email_shutdown */
+ 
+@@ -248,7 +270,16 @@ static int notify_email_notification (const notification_t *n,
+       n->host,
+       n->message);
+ 
++  pthread_mutex_lock (&session_lock);
++
++  if (session == NULL) {
++    /* Initialization failed or we're in the process of shutting down. */
++    pthread_mutex_unlock (&session_lock);
++    return (-1);
++  }
++
+   if (!(message = smtp_add_message (session))) {
++    pthread_mutex_unlock (&session_lock);
+     ERROR ("notify_email plugin: cannot set SMTP message");
+     return (-1);   
+   }
+@@ -264,6 +295,7 @@ static int notify_email_notification (const notification_t *n,
+     char buf[MAXSTRING];
+     ERROR ("notify_email plugin: SMTP server problem: %s",
+         smtp_strerror (smtp_errno (), buf, sizeof buf));
++    pthread_mutex_unlock (&session_lock);
+     return (-1);
+   } else {
+     const smtp_status_t *status;
+@@ -274,6 +306,7 @@ static int notify_email_notification (const notification_t *n,
+     smtp_enumerate_recipients (message, print_recipient_status, NULL);
+   }
+ 
++  pthread_mutex_unlock (&session_lock);
+   return (0);
+ } /* int notify_email_notification */
+ 
only in patch2:
unchanged:
--- collectd-4.10.1.orig/debian/patches/bts596128-reheap-fix.dpatch
+++ collectd-4.10.1/debian/patches/bts596128-reheap-fix.dpatch
@@ -0,0 +1,46 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts596128-reheap-fix.dpatch by Florian Forster <octo@verplant.org>
+##
+## DP: src/utils_heap.c: Fix calculation of the parent's index.
+## DP:
+## DP: This resulted in the "upwards" reheap function to return prematurely,
+## DP: leaving the heap condition violated.
+
+@DPATCH@
+
+diff a/src/utils_heap.c b/src/utils_heap.c
+--- a/src/utils_heap.c
++++ b/src/utils_heap.c
+@@ -96,7 +96,7 @@ static void reheap (c_heap_t *h, size_t root, enum reheap_direction dir)
+     return;
+ 
+   if (dir == DIR_UP)
+-    reheap (h, root / 2, dir);
++    reheap (h, (root - 1) / 2, dir);
+   else if (dir == DIR_DOWN)
+     reheap (h, min, dir);
+ } /* void reheap */
+@@ -140,6 +140,8 @@ void c_heap_destroy (c_heap_t *h)
+ 
+ int c_heap_insert (c_heap_t *h, void *ptr)
+ {
++  size_t index;
++
+   if ((h == NULL) || (ptr == NULL))
+     return (-EINVAL);
+ 
+@@ -162,11 +164,12 @@ int c_heap_insert (c_heap_t *h, void *ptr)
+   }
+ 
+   /* Insert the new node as a leaf. */
+-  h->list[h->list_len] = ptr;
++  index = h->list_len;
++  h->list[index] = ptr;
+   h->list_len++;
+ 
+   /* Reorganize the heap from bottom up. */
+-  reheap (h, /* parent of this node = */ (h->list_len - 1) / 2, DIR_UP);
++  reheap (h, /* parent of this node = */ (index - 1) / 2, DIR_UP);
+   
+   pthread_mutex_unlock (&h->lock);
+   return (0);
only in patch2:
unchanged:
--- collectd-4.10.1.orig/debian/patches/bts592623-curl_json-file.dpatch
+++ collectd-4.10.1/debian/patches/bts592623-curl_json-file.dpatch
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts592623-curl_json-file.dpatch by Florian Forster <octo@verplant.org>
+##
+## DP: curl json: Fix checking the response code.
+## DP:
+## DP: This fixes access to file:// URLs.
+
+@DPATCH@
+
+diff a/src/curl_json.c b/src/curl_json.c
+--- a/src/curl_json.c
++++ b/src/curl_json.c
+@@ -775,7 +775,8 @@ static int cj_curl_perform (cj_t *db, CURL *curl) /* {{{ */
+   curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
+   curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &rc);
+ 
+-  if (rc != 200)
++  /* The response code is zero if a non-HTTP transport was used. */
++  if ((rc != 0) && (rc != 200))
+   {
+     ERROR ("curl_json plugin: curl_easy_perform failed with response code %ld (%s)",
+            rc, url);

Attachment: signature.asc
Description: Digital signature


Reply to: