<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="generator" content="Osso Notes">
    <title></title></head>
<body>
<p>----- Original message -----
<br>&gt; Thanks for the quick reply.&nbsp; &#32;See my comments below.
<br>&gt; 
<br>&gt; &gt; -----Original Message-----
<br>&gt; &gt; From: <a href="mailto:syslog-ng-bounces@lists.balabit.hu">syslog-ng-bounces@lists.balabit.hu</a> [mailto:syslog-ng-
<br>&gt; &gt; <a href="mailto:bounces@lists.balabit.hu">bounces@lists.balabit.hu</a>] On Behalf Of Balazs Scheidler
<br>&gt; &gt; Sent: Saturday, March 31, 2012 2:22 PM
<br>&gt; &gt; To: Syslog-ng users' and developers' mailing list
<br>&gt; &gt; Subject: Re: [syslog-ng] Ongoing 3.3.4 memory leaks
<br>&gt; &gt; 
<br>&gt; &gt; On Fri, 2012-03-30 at 16:52 -0500, Marvin Nipper wrote:
<br>&gt; &gt; &gt; Hi.
<br>&gt; &gt; &gt; 
<br>&gt; &gt; &gt; Sorry, looking for some help.&nbsp; &#32;Still trying to chase some memory
<br>&gt; &gt; leaks
<br>&gt; &gt; &gt; that I see on Solaris 10.&nbsp; &#32;I’ll crank up syslog-ng, and it’ll start
<br>&gt; &gt; &gt; running at around 7 or 8MB, and interestingly, it will run that way
<br>&gt; &gt; &gt; sometimes for several hours, and then (for reasons unknown), I’ll
<br>&gt; &gt; take
<br>&gt; &gt; &gt; a look at it a bit later, and suddenly it will have jumped to 26MB
<br>&gt; &gt; (or
<br>&gt; &gt; &gt; later on, maybe 75MB).&nbsp; &#32;I’ve already applied the (older) logwriter.c
<br>&gt; &gt; &gt; fix and the (new) Gergely driver.h/afsocket.c fix, in an attempt to
<br>&gt; &gt; &gt; resolve known issues.&nbsp; &#32;Certainly the logwriter fix corrected a
<br>&gt; &gt; &gt; super-nasty, continuous leak problem, but this other leak problem
<br>&gt; &gt; &gt; still lingers.
<br>&gt; &gt; 
<br>&gt; &gt; I'm not sure which fixes you've applied. Can you post a better
<br>&gt; &gt; reference?
<br>&gt; [Marvin Nipper] 
<br>&gt; They are the logwriter fix that you mentioned just below, and also the
<br>&gt; afsocket patch that you were discussing this weekend in the "Memory leak
<br>&gt; reintroduced in 3.3.3" thread.&nbsp; &#32;However, based upon your comments (in
<br>&gt; that thread), I plan to "unwind" that set of changes, as it seems like
<br>&gt; those may not have been legit.
<br>&gt; 
<br>&gt; 
<br>
<br>I've processed those after answering your email.
<br>
<br>&gt; 
<br>&gt; &gt; 
<br>&gt; &gt; I've applied only one patch after v3.3.4 got released which fixes a
<br>&gt; &gt; memory leak, this one:
<br>&gt; &gt; 
<br>&gt; &gt; logwriter: fixed a memory leak for messages that couldn't be
<br>&gt; &gt; flushed at once
<br>&gt; &gt; 
<br>&gt; &gt; Sometimes a message is dequeued, and then can't be posted to the
<br>&gt; &gt; destination
<br>&gt; &gt; (probably because of an EAGAIN or something like that). In this
<br>&gt; &gt; case
<br>&gt; &gt; it is readded back to the queue. In this case a reference was lost,
<br>&gt; &gt; causing
<br>&gt; &gt; a memory leak, but not for all messages, but only for the affected
<br>&gt; &gt; ones.
<br>&gt; &gt; 
<br>&gt; &gt; Reported-By: Evan Rempel &lt;<a href="mailto:erempel@uvic.ca">erempel@uvic.ca</a>&gt;
<br>&gt; &gt; Signed-off-by: Balazs Scheidler &lt;<a href="mailto:bazsi@balabit.hu">bazsi@balabit.hu</a>&gt;
<br>&gt; &gt; 
<br>&gt; &gt; I can't remember anything else, hopefully I haven't missed patches by
<br>&gt; &gt; Gergely.
<br>&gt; &gt; &gt; 
<br>&gt; &gt; &gt; MY PROBLEM is that I’m wanting to use the debug symbols in syslog-ng,
<br>&gt; &gt; &gt; so that I can have the Solaris tools specifically show the exact
<br>&gt; &gt; &gt; location where these leaks are happening, BUT, whereas a non-
<br>&gt; &gt; debugging
<br>&gt; &gt; &gt; version of syslog-ng executes properly, when I configure syslog-ng
<br>&gt; &gt; &gt; with –enable-debug, the resulting executable will no longer start.
<br>&gt; &gt; It
<br>&gt; &gt; &gt; immediately exits, coughing up what amounts to a syntax error (even
<br>&gt; &gt; &gt; though I’m using the exact same command-line invocation that I use on
<br>&gt; &gt; &gt; the non-debugged executable):
<br>&gt; &gt; &gt; 
<br>&gt; &gt; &gt; 
<br>&gt; &gt; &gt; #/etc/init.d/syslog-ng start
<br>&gt; &gt; &gt; syslog-ng service starting.
<br>&gt; &gt; &gt; mkfifo: File exists
<br>&gt; &gt; &gt; mkfifo: File exists
<br>&gt; &gt; &gt; Usage: /usr/local/sbin/syslog-ng { start | stop }
<br>&gt; &gt; &gt; #
<br>&gt; &gt; &gt; 
<br>&gt; &gt; &gt; Something about enabling debugging is impacting the operational
<br>&gt; &gt; &gt; behavior of the resulting binary.
<br>&gt; &gt; 
<br>&gt; &gt; Hmm.&nbsp; &#32;That output is strange, you said you were running Solaris, but
<br>&gt; &gt; Solaris uses SMF for service management. Yet, you executed an sysv init
<br>&gt; &gt; script, which then complained that /usr/local/sbin/syslog-ng has
<br>&gt; &gt; different options, even though /usr/local/sbin/syslog-ng is probably
<br>&gt; &gt; your syslog-ng executable (or at least that's the default path).
<br>&gt; &gt; 
<br>&gt; &gt; Can you perhaps start syslog-ng by hand?
<br>&gt; &gt; 
<br>&gt; &gt; /usr/local/sbin/syslog-ng -F
<br>&gt; &gt; 
<br>&gt; &gt; should do it.
<br>&gt; [Marvin Nipper] 
<br>&gt; Actually, I had already done that, but here's that output, just to show
<br>&gt; you: # /usr/local/sbin/syslog-ng \
<br>&gt; &gt; -F -f /etc/syslog-ng/syslog-ng.conf \
<br>&gt; &gt; -p /var/run/syslog-ng.pid \
<br>&gt; &gt; --persist-file=/usr/local/syslog-ng/syslog-ng.persist
<br>&gt; Usage: /usr/local/sbin/syslog-ng { start | stop }
<br>&gt; 
<br>
<br>this isn't syslog-ng that produces this output. maybe the installation overwrote it? is that file a shell script? 
<br>
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt;&nbsp; &#32;Debug symbols shouldn't affect how things run.
<br>&gt; &gt; --enable-debug only adds a couple of options to CFLAGS, and only if the
<br>&gt; &gt; compiler is gcc.
<br>&gt; &gt; 
<br>&gt; &gt; if test "x$ac_compiler_gnu" = "xyes"; then
<br>&gt; &gt; CFLAGS="${CFLAGS} -Wall"
<br>&gt; &gt; if test "x$enable_debug" = "xyes"; then
<br>&gt; &gt; CFLAGS="${ac_cv_env_CFLAGS_value} -Wall -g"
<br>&gt; &gt; fi
<br>&gt; &gt; 
<br>&gt; &gt; if test "x$enable_gprof" = "xyes"; then
<br>&gt; &gt; CFLAGS="${CFLAGS} -pg"
<br>&gt; &gt; fi
<br>&gt; &gt; if test "x$enable_gcov" = "xyes"; then
<br>&gt; &gt; CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
<br>&gt; &gt; fi
<br>&gt; &gt; fi
<br>&gt; &gt; CFLAGS="${CFLAGS} -pthread"
<br>&gt; &gt; 
<br>&gt; &gt; If nothing else, try passing -g in CFLAGS before running configure,
<br>&gt; &gt; without
<br>&gt; &gt; passing --enable-debug.
<br>&gt; [Marvin Nipper] 
<br>&gt; I actually didn't even know that the --enable-debug option existed in
<br>&gt; the syslog-ng config, and so I started this effort by doing a
<br>&gt; compilation with -g in CFLAGS, and that's when I first encountered the
<br>&gt; syntax issue (that results in the "Usage" error).&nbsp; &#32;When that goofy
<br>&gt; result occurred, I figured that I'd done something wrong, and then
<br>&gt; stumbled into the debug capability "built into" your configure
<br>&gt; scripting, so I tried that next, which ends up with the same result.
<br>&gt; 
<br>&gt; So, I don't know if this is yet another "goofy Solaris problem", but
<br>&gt; some aspect of enabling the debug symbols, seems to frak up some aspect
<br>&gt; of processing the command line at startup.
<br>&gt; 
<br>&gt; If you have any other ideas or thoughts, I'll certainly take them.&nbsp; &#32;I
<br>&gt; appreciate your time and input.
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; &gt; 
<br>&gt; &gt; &gt; 
<br>&gt; &gt; &gt; Anyway, I can use (for Solaris) libumem and mdb to narrow this down
<br>&gt; &gt; to
<br>&gt; &gt; &gt; a particular module, but without the debug symbols, I can’t really
<br>&gt; &gt; get
<br>&gt; &gt; &gt; to a specific chunk of code, so it would obviously help to get that
<br>&gt; &gt; &gt; working.&nbsp; &#32;If anyone has any ideas, I certainly would appreciate the
<br>&gt; &gt; &gt; input.
<br>&gt; &gt; &gt; 
<br>&gt; &gt; 
<br>&gt; &gt; It'd really be appreciated if you could point out where the leak is
<br>&gt; &gt; happening. It might be use-case specific or some failure handler or
<br>&gt; &gt; whatever. Let's hope that starting syslog-ng from the command line
<br>&gt; &gt; works.
<br>&gt; &gt; 
<br>&gt; &gt; --
<br>&gt; &gt; Bazsi
<br>&gt; &gt; 
<br>&gt; &gt; 
<br>&gt; &gt; _______________________________________________________________________
<br>&gt; &gt; _______
<br>&gt; &gt; Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a>
<br>&gt; &gt; Documentation:
<br>&gt; &gt; <a href="http://www.balabit.com/support/documentation/?product=syslog-ng">http://www.balabit.com/support/documentation/?product=syslog-ng</a>
<br>&gt; &gt; FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq">http://www.balabit.com/wiki/syslog-ng-faq</a>
<br>&gt; 
<br>&gt; 
<br>&gt; 
<br>&gt; This e-mail may contain confidential and/or privileged information. If
<br>&gt; you are not the intended recipient (or have received this e-mail in
<br>&gt; error) please&nbsp; &#32;notify the sender immediately and destroy this e-mail.
<br>&gt; Any unauthorized&nbsp; &#32;copying, disclosure or distribution of the material in
<br>&gt; this e-mail is strictly&nbsp; &#32;forbidden.
<br>&gt; 
<br>&gt; ______________________________________________________________________________
<br>&gt; Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a>
<br>&gt; Documentation:
<br>&gt; <a href="http://www.balabit.com/support/documentation/?product=syslog-ng">http://www.balabit.com/support/documentation/?product=syslog-ng</a> FAQ:
<br>&gt; <a href="http://www.balabit.com/wiki/syslog-ng-faq">http://www.balabit.com/wiki/syslog-ng-faq</a>
<br>&gt; 
<br><br></p>
</body>
</html>