Package: xymon
Version: 4.3.17-5
Severity: serious
Tags: patch pending fixed-upstream

Before christmas, I've setup a new Jessie installation with Xymon. Since
two or three weeks ago that installation is fed with all the monitoring
data our current and Wheezy based production monitoring server gets.
After approximately one week without restart, the xymond process on the
Jessie installation grew to 15 GB of memory usage.

Valgrind showed chunks of ca. 9 MB and 3.5 MB getting lost. Xymons
typical activity interval is 5 minutes. (The 9 MB sound realistic:
Summing up 9 MB every 5 minutes for a week would get 17.7 GB.)

How quick the memory usage grows seems to depend on the installation
and/or usage, too. I also have a 4.3.17-2 backport running on Wheezy for
many months, and we only had a single case where it ran long enough (3
months without restart) so that the memory usage grew in areas where we
noticed something. But that installation has way fewer hosts to monitor
and hence fewer messages to handle (2 vs 28 incoming messages per
second), so the memory leak didn't become that obvious as it is now.

And the memory leak has been fixed upstream with their recent 4.3.18
release (03-Feb-2015). The 4.3.18 upstream changelog contains the
following changelog entry:

  - xymond: Fix memory leak

With cherry-picking the following two patches from upstream's 4.3.18
branch in SVN, the memory usage of the same installation stayed around
256 MB of RAM usage (fluctuating between 247 MB and 263 MB) after three
hours despite it grew to over 300 MB after less than 30 minutes before.

And Valgrind seems happy since then, too.

Description:Fix memory leak in acknowledge handling.
 Cherry-picked from the 4.3.18 upstream release.
Origin: http://sourceforge.net/p/xymon/code/7488/
Applied-Upstream: http://sourceforge.net/p/xymon/code/7488/
Reviewed-by: Axel Beckert <a...@debian.org>

Index: xymon/xymond/xymond.c
===================================================================
--- xymon.orig/xymond/xymond.c  2015-02-13 15:38:17.000000000 +0100
+++ xymon/xymond/xymond.c       2015-02-13 15:40:05.000000000 +0100
@@ -2365,6 +2365,8 @@
        if (zombie->dismsg) xfree(zombie->dismsg);
        if (zombie->ackmsg) xfree(zombie->ackmsg);
        if (zombie->grouplist) xfree(zombie->grouplist);
+       if (zombie->lastchange) xfree(zombie->lastchange);
+       if (zombie->testflags) xfree(zombie->testflags);
        flush_acklist(zombie, 1);
        xfree(zombie);
        dbgprintf("<- free_log_t\n");

Description: Set an initial size for the xymondlog output
 Cherry-picked from the 4.3.18 upstream release.
 .
 Original commit message: "xymond: Set an initial size for the
 xymondlog output, to avoid realloc'ing the buffer too much. Fix a
 valgrind complaint. JC Cleaver"
 .
 Despite the harmless sounding commit message, this seems to fix a
 severe memory leak. Without this patch, valgrind reported the loss of
 about 12 MB every five minutes on a bigger installation.
Origin: http://sourceforge.net/p/xymon/code/7489/
Applied-Upstream: http://sourceforge.net/p/xymon/code/7489/

Index: xymon/xymond/xymond.c
===================================================================
--- xymon.orig/xymond/xymond.c  2015-02-13 16:50:42.000000000 +0100
+++ xymon/xymond/xymond.c       2015-02-13 17:21:42.000000000 +0100
@@ -3679,12 +3679,13 @@
                        }
 
                        xfree(msg->buf);
-                       logdata = generate_outbuf(NULL, logfields, h, log, 
acklevel);
+                       logdata = newstrbuffer(20480);
+                       logdata = generate_outbuf(&logdata, logfields, h, log, 
acklevel);
                        addtobuffer(logdata, msg_data(log->message, 0));
 
                        msg->doingwhat = RESPONDING;
                        msg->buflen = STRBUFLEN(logdata);
-                       msg->bufp = grabstrbuffer(logdata);
+                       msg->bufp = msg->buf = grabstrbuffer(logdata);
                }
 
                clear_filter(logfilter);

I intend to upload 4.3.17-6 with these two patches, the added CVE-ID for
the previous upload and one translation update. I will initially upload
it to the DELAYED queue and will then request a freeze exception for
Jessie.

All of that is already checked in into the "jessie" branch at
https://anonscm.debian.org/cgit/collab-maint/xymon.git/log/?h=jessie

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (500, 'buildd-unstable'), 
(400, 'stable'), (110, 'experimental'), (1, 'buildd-experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.18.0-trunk-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to