[syslog-ng] 3.1 Beta 1 memory leak?

Balazs Scheidler bazsi at balabit.hu
Wed Dec 16 06:31:34 CET 2009


On Mon, 2009-12-14 at 15:23 +0100, Balazs Scheidler wrote:
> On Fri, 2009-12-11 at 11:47 -0600, Martin Holste wrote:
> > I'm trying the new 3.1 beta 1 build, and even with log_fifo_size(0),
> > syslog-ng consumes all available memory until the kernel out-of-memory
> > manager kills it.  At first I thought this had something to do with
> > UDP forwarding to a destination, but even with that disabled, the
> > uncontrolled consumption occurs.  I reconfigured with the most basic
> > configuration to just dump everything to /dev/null, and though the
> > leak is slower, the leak continues.
> > 
> > Compiled with:
> > Glibc-2.20.3
> > PCRE 7.9
> > 
> > syslog-ng 3.1beta1
> > Installer-Version: 3.1beta1
> > Revision: ssh+git://bazsi@git.balabit//var/scm/git/syslog-ng/syslog-ng-ose--mainline--3.1#master#3412dce0235e8d65bc3bebedffe8ff6bed02f45b
> > Compile-Date: Dec 11 2009 11:36:51
> > Enable-Threads: off
> > Enable-Debug: off
> > Enable-GProf: off
> > Enable-Memtrace: off
> > Enable-Sun-STREAMS: off
> > Enable-Sun-Door: off
> > Enable-IPv6: on
> > Enable-Spoof-Source: on
> > Enable-TCP-Wrapper: off
> > Enable-SSL: on
> > Enable-SQL: off
> > Enable-Linux-Caps: off
> > Enable-Pcre: on
> > 
> > Configuration:
> > 
> > @version: 3.0
> > options {
> >         ts_format(iso);
> >         stats_level(1);
> >         stats_freq(30);
> >         keep_hostname(no);
> >         chain_hostnames(yes);
> >         create_dirs(yes);
> > };
> > source s_tcp {
> >         tcp(ip(0.0.0.0) port(514));
> > };
> > source s_udp {
> >         udp(ip(0.0.0.0) port(514));
> > };
> > destination d_null {
> >         file("/dev/null");
> > };
> > log {
> >         source(s_udp);
> >         source(s_tcp);
> >         destination(d_null);
> > };
> 
> thanks for letting me know. Can you fire up valgrind to check what leaks
> memory? That'd be termendous help and would be appreciated.
> 

This has been fixed off-list, and the result was committed as two
patches:

commit 9ef6062c1cf72a3f7da880ac245f9ee080bea992
Author: Balazs Scheidler <bazsi at balabit.hu>
Date:   Tue Dec 15 17:09:50 2009 +0100

    fixed another memory leak, patterndb had an unused GPtrArray allocated
    
    The match_names array is not used in the new LogMessage payload structure
    however an allocation has been missed when deleting the unneeded code.
    
    Reported-By: Martin Holste

commit bb3301baa8c3324cbb899e1a8b08a1955fe47d39
Author: Balazs Scheidler <bazsi at balabit.hu>
Date:   Tue Dec 15 14:08:27 2009 +0100

    Fixed memory leak when resolving the sender's hostname
    
    Thanks for the reporter for producing a valgrind log, it was a trivial
    memory leak that was caused by the fact that one of the internal APIs
    were changed: instead of requiring a caller-allocated string, it now
    only requires read-only access to the string.
    
    Reported-By: Martin Holste


-- 
Bazsi




More information about the syslog-ng mailing list