[syslog-ng]Syslog-NG 1.6.6 memory leak when sending UDP logs

syslog-ng@lists.balabit.hu syslog-ng@lists.balabit.hu
Mon, 28 Feb 2005 11:27:42 -0500


This is a multipart message in MIME format.
--=_alternative 005A87F785256FB6_=
Content-Type: text/plain; charset="US-ASCII"

The installation is a fresh 1.6.6 installation on a clean install of 
Redhat 3.0.    It's been running fine for about 2 weeks logging the same 
amount of traffic to local files only.
When I turned on the UDP destinations, it started chewing up memory.  The 
destinations are receiving logs entries properly, and the source address 
is properly spoofed. 

Versions of libs:

libnet 1.1.2
libol 0.3.14

Here's the syslog-ng config file - the only thing that changed to cause 
this memory eating behavior is the 3 lines under "# Sets up local 
destination for Cisco logs". It makes no difference if I am sending to a 
single host, or multiple, the memory "leak" is still there.

I have it currently running under "ElectricFence"  looking for malloc 
problems - so far none, just memory consumption. 

-------------------------------------------
options { long_hostnames(off); sync(0); };

source src { unix-stream("/dev/log"); internal(); };
source kernsrc { file("/proc/kmsg"); };
source net { udp(port(514)); };


# Sets up local desitation for Cisco logs
destination ciscolog { file("/var/log/cisco.log"); };

# Sets up forwarding to other hosts
destination loghostd { udp(loghostd spoof_source(yes)); };
destination loghosta { udp(loghosta spoof_source(yes)); };
destination scribe02 { udp(scribe02 spoof_source(yes)); };

# standard localhost logging stuff
destination authlog { file("/var/log/auth.log"); };
destination syslog { file("/var/log/syslog"); };
destination cron { file("/var/log/cron.log"); };
destination daemon { file("/var/log/daemon.log"); };
destination kern { file("/var/log/kern.log"); };
destination lpr { file("/var/log/lpr.log"); };
destination user { file("/var/log/user.log"); };
destination uucp { file("/var/log/uucp.log"); };
destination ppp { file("/var/log/ppp.log"); };
destination mail { file("/var/log/mail.log"); };

destination mailinfo { file("/var/log/mail.info"); };
destination mailwarn { file("/var/log/mail.warn"); };
destination mailerr { file("/var/log/mail.err"); };
destination local0 { file("/var/log/local0.log"); };
destination local1 { file("/var/log/local1.log"); };

destination all { file("/var/log/all.log"); };
destination allnet { file("/var/log/allnet.log"); };

destination newscrit { file("/var/log/news/news.crit"); };
destination newserr { file("/var/log/news/news.err"); };
destination newsnotice { file("/var/log/news/news.notice"); };

destination debug { file("/var/log/debug"); };
destination messages { file("/var/log/messages"); };
destination console { usertty("root"); };
destination console_all { file("/dev/tty12"); };




# Filters Cisco events - well, at least local7 and local4 events
filter f_cisco { facility(local7,local4);};
filter f_notcisco {not facility(local7, local4); };

filter f_auth { facility(auth); };
filter f_authpriv { facility(auth, authpriv); };
filter f_syslog { not facility(authpriv, mail) and not match(ppp.*LCP); };
filter f_cron { facility(cron); };
filter f_daemon { facility(daemon); };
filter f_kern { facility(kern); };
filter f_lpr { facility(lpr); };
filter f_mail { facility(mail) and not match (imapd); };
filter f_user { facility(user); };
filter f_uucp { facility(cron); };
filter f_ppp { program(ppp); };
filter f_news { facility(news); };
filter f_debug { not facility(auth, authpriv, news, mail) and not 
match(ppp.*LCP); };
filter f_messages { level(info..warn) 
        and not facility(auth, authpriv, mail, news); };
filter f_emergency { level(emerg); };

filter f_info { level(info); };
filter f_notice { level(notice); };
filter f_warn { level(warn); };
filter f_crit { level(crit); };
filter f_err { level(err); };


# Reflects Cisco SYSLOG packets to remote hosts
log { source(net); filter(f_cisco); destination(loghostd); };
log { source(net); filter(f_cisco); destination(loghosta); };
log { source(net); filter(f_cisco); destination(scribe02); };

# Keeps a copy for ourself
log { source(net); filter(f_cisco); destination(ciscolog); };


log { source(src); filter(f_authpriv); destination(authlog); };
log { source(src); filter(f_syslog); destination(syslog); };
log { source(src); filter(f_cron); destination(cron); };
log { source(src); filter(f_daemon); destination(daemon); };
log { source(kernsrc); filter(f_kern); destination(kern); };
log { source(src); filter(f_lpr); destination(lpr); };
log { source(src); filter(f_mail); destination(mail); };
log { source(src); filter(f_user); destination(user); };
log { source(src); filter(f_uucp); destination(uucp); };
log { source(src); filter(f_mail); filter(f_info); destination(mailinfo); 
};
log { source(src); filter(f_mail); filter(f_warn); destination(mailwarn); 
};
log { source(src); filter(f_mail); filter(f_err); destination(mailerr); };
log { source(src); filter(f_news); filter(f_crit); destination(newscrit); 
};
log { source(src); filter(f_news); filter(f_err); destination(newserr); };
log { source(src); filter(f_news); filter(f_notice); 
destination(newsnotice); };
log { source(src); filter(f_debug); destination(debug); };
log { source(src); filter(f_messages); destination(messages); };
log { source(src); filter(f_emergency); destination(console); };
log { source(src); filter(f_ppp); destination(ppp); };
log { source(src); destination(console_all); };

log { source(src); destination(all); };

# Log all non cisco stuff to localfile for debugging
log { source(net); filter(f_notcisco); destination(allnet); };


Henry -




Balazs Scheidler <bazsi@balabit.hu> 
Sent by: syslog-ng-admin@lists.balabit.hu
02/28/2005 11:11 AM
Please respond to
syslog-ng@lists.balabit.hu


To
syslog-ng@lists.balabit.hu
cc

Subject
Re: [syslog-ng]Syslog-NG 1.6.6 memory leak when sending UDP logs






On Mon, 2005-02-28 at 09:36 -0500, henry@shoelacecity.com wrote:
> 
> I'm running 1.6.6 on Linux Redhat ES 3.0 logging Cisco router logs to
> local files and it's been running just fine for over a week. 
> I just enabled  forwarding for local4 and local7 (with spoof UDP)  to
> 2 additional hosts via UDP and noticed, within a day, that it
> syslog-NG has consumed all available memory.   It continues to log,
> however, the system starts killing processes off unless I restart
> syslog-ng. 

If I understand you correctly you use syslog-ng to send logs to another
host via UDP. Is it a new installation or this installation has worked
so far and upgrading to 1.6.6 is what triggered the problem?

Are you using address spoofing (spoof-source(yes))? Can you post your
configuration file?

-- 
Bazsi


_______________________________________________
syslog-ng maillist  -  syslog-ng@lists.balabit.hu
https://lists.balabit.hu/mailman/listinfo/syslog-ng
Frequently asked questions at http://www.campin.net/syslog-ng/faq.html



--=_alternative 005A87F785256FB6_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">The installation is a fresh 1.6.6 installation
on a clean install of Redhat 3.0. &nbsp; &nbsp;It's been running fine for
about 2 weeks logging the same amount of traffic to local files only.</font>
<br><font size=2 face="sans-serif">When I turned on the UDP destinations,
it started chewing up memory. &nbsp;The destinations are receiving logs
entries properly, and the source address is properly spoofed. </font>
<br>
<br><font size=2 face="sans-serif">Versions of libs:</font>
<br>
<br><font size=2 face="sans-serif">libnet 1.1.2</font>
<br><font size=2 face="sans-serif">libol 0.3.14</font>
<br>
<br><font size=2 face="sans-serif">Here's the syslog-ng config file - the
only thing that changed to cause this memory eating behavior is the 3 lines
under &quot;# Sets up local destination for Cisco logs&quot;. It makes
no difference if I am sending to a single host, or multiple, the memory
&quot;leak&quot; is still there.</font>
<br>
<br><font size=2 face="sans-serif">I have it currently running under &quot;ElectricFence&quot;
&nbsp;looking for malloc problems - so far none, just memory consumption.
</font>
<br>
<br><font size=2 face="sans-serif">-------------------------------------------</font>
<br><font size=2 face="sans-serif">options { long_hostnames(off); sync(0);
};</font>
<br>
<br><font size=2 face="sans-serif">source src { unix-stream(&quot;/dev/log&quot;);
internal(); };</font>
<br><font size=2 face="sans-serif">source kernsrc { file(&quot;/proc/kmsg&quot;);
};</font>
<br><font size=2 face="sans-serif">source net { udp(port(514)); };</font>
<br>
<br>
<br><font size=2 face="sans-serif"># Sets up local desitation for Cisco
logs</font>
<br><font size=2 face="sans-serif">destination ciscolog { file(&quot;/var/log/cisco.log&quot;);
};</font>
<br>
<br><font size=2 face="sans-serif"># Sets up forwarding to other hosts</font>
<br><font size=2 face="sans-serif">destination loghostd { udp(loghostd
spoof_source(yes)); };</font>
<br><font size=2 face="sans-serif">destination loghosta { udp(loghosta
spoof_source(yes)); };</font>
<br><font size=2 face="sans-serif">destination scribe02 { udp(scribe02
spoof_source(yes)); };</font>
<br>
<br><font size=2 face="sans-serif"># standard localhost logging stuff</font>
<br><font size=2 face="sans-serif">destination authlog { file(&quot;/var/log/auth.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination syslog { file(&quot;/var/log/syslog&quot;);
};</font>
<br><font size=2 face="sans-serif">destination cron { file(&quot;/var/log/cron.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination daemon { file(&quot;/var/log/daemon.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination kern { file(&quot;/var/log/kern.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination lpr { file(&quot;/var/log/lpr.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination user { file(&quot;/var/log/user.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination uucp { file(&quot;/var/log/uucp.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination ppp { file(&quot;/var/log/ppp.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination mail { file(&quot;/var/log/mail.log&quot;);
};</font>
<br>
<br><font size=2 face="sans-serif">destination mailinfo { file(&quot;/var/log/mail.info&quot;);
};</font>
<br><font size=2 face="sans-serif">destination mailwarn { file(&quot;/var/log/mail.warn&quot;);
};</font>
<br><font size=2 face="sans-serif">destination mailerr { file(&quot;/var/log/mail.err&quot;);
};</font>
<br><font size=2 face="sans-serif">destination local0 { file(&quot;/var/log/local0.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination local1 { file(&quot;/var/log/local1.log&quot;);
};</font>
<br>
<br><font size=2 face="sans-serif">destination all { file(&quot;/var/log/all.log&quot;);
};</font>
<br><font size=2 face="sans-serif">destination allnet { file(&quot;/var/log/allnet.log&quot;);
};</font>
<br>
<br><font size=2 face="sans-serif">destination newscrit { file(&quot;/var/log/news/news.crit&quot;);
};</font>
<br><font size=2 face="sans-serif">destination newserr { file(&quot;/var/log/news/news.err&quot;);
};</font>
<br><font size=2 face="sans-serif">destination newsnotice { file(&quot;/var/log/news/news.notice&quot;);
};</font>
<br>
<br><font size=2 face="sans-serif">destination debug { file(&quot;/var/log/debug&quot;);
};</font>
<br><font size=2 face="sans-serif">destination messages { file(&quot;/var/log/messages&quot;);
};</font>
<br><font size=2 face="sans-serif">destination console { usertty(&quot;root&quot;);
};</font>
<br><font size=2 face="sans-serif">destination console_all { file(&quot;/dev/tty12&quot;);
};</font>
<br>
<br>
<br>
<br>
<br><font size=2 face="sans-serif"># Filters Cisco events - well, at least
local7 and local4 events</font>
<br><font size=2 face="sans-serif">filter f_cisco { facility(local7,local4);};</font>
<br><font size=2 face="sans-serif">filter f_notcisco {not facility(local7,
local4); };</font>
<br>
<br><font size=2 face="sans-serif">filter f_auth { facility(auth); };</font>
<br><font size=2 face="sans-serif">filter f_authpriv { facility(auth, authpriv);
};</font>
<br><font size=2 face="sans-serif">filter f_syslog { not facility(authpriv,
mail) and not match(ppp.*LCP); };</font>
<br><font size=2 face="sans-serif">filter f_cron { facility(cron); };</font>
<br><font size=2 face="sans-serif">filter f_daemon { facility(daemon);
};</font>
<br><font size=2 face="sans-serif">filter f_kern { facility(kern); };</font>
<br><font size=2 face="sans-serif">filter f_lpr { facility(lpr); };</font>
<br><font size=2 face="sans-serif">filter f_mail { facility(mail) and not
match (imapd); };</font>
<br><font size=2 face="sans-serif">filter f_user { facility(user); };</font>
<br><font size=2 face="sans-serif">filter f_uucp { facility(cron); };</font>
<br><font size=2 face="sans-serif">filter f_ppp { program(ppp); };</font>
<br><font size=2 face="sans-serif">filter f_news { facility(news); };</font>
<br><font size=2 face="sans-serif">filter f_debug { not facility(auth,
authpriv, news, mail) and not match(ppp.*LCP); };</font>
<br><font size=2 face="sans-serif">filter f_messages { level(info..warn)
</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; and
not facility(auth, authpriv, mail, news); };</font>
<br><font size=2 face="sans-serif">filter f_emergency { level(emerg); };</font>
<br>
<br><font size=2 face="sans-serif">filter f_info { level(info); };</font>
<br><font size=2 face="sans-serif">filter f_notice { level(notice); };</font>
<br><font size=2 face="sans-serif">filter f_warn { level(warn); };</font>
<br><font size=2 face="sans-serif">filter f_crit { level(crit); };</font>
<br><font size=2 face="sans-serif">filter f_err { level(err); };</font>
<br>
<br>
<br><font size=2 face="sans-serif"># Reflects Cisco SYSLOG packets to remote
hosts</font>
<br><font size=2 face="sans-serif">log { source(net); filter(f_cisco);
destination(loghostd); };</font>
<br><font size=2 face="sans-serif">log { source(net); filter(f_cisco);
destination(loghosta); };</font>
<br><font size=2 face="sans-serif">log { source(net); filter(f_cisco);
destination(scribe02); };</font>
<br>
<br><font size=2 face="sans-serif"># Keeps a copy for ourself</font>
<br><font size=2 face="sans-serif">log { source(net); filter(f_cisco);
destination(ciscolog); };</font>
<br>
<br>
<br><font size=2 face="sans-serif">log { source(src); filter(f_authpriv);
destination(authlog); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_syslog);
destination(syslog); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_cron); destination(cron);
};</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_daemon);
destination(daemon); };</font>
<br><font size=2 face="sans-serif">log { source(kernsrc); filter(f_kern);
destination(kern); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_lpr); destination(lpr);
};</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_mail); destination(mail);
};</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_user); destination(user);
};</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_uucp); destination(uucp);
};</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_mail); filter(f_info);
destination(mailinfo); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_mail); filter(f_warn);
destination(mailwarn); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_mail); filter(f_err);
destination(mailerr); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_news); filter(f_crit);
destination(newscrit); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_news); filter(f_err);
destination(newserr); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_news); filter(f_notice);
destination(newsnotice); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_debug);
destination(debug); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_messages);
destination(messages); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_emergency);
destination(console); };</font>
<br><font size=2 face="sans-serif">log { source(src); filter(f_ppp); destination(ppp);
};</font>
<br><font size=2 face="sans-serif">log { source(src); destination(console_all);
};</font>
<br>
<br><font size=2 face="sans-serif">log { source(src); destination(all);
};</font>
<br>
<br><font size=2 face="sans-serif"># Log all non cisco stuff to localfile
for debugging</font>
<br><font size=2 face="sans-serif">log { source(net); filter(f_notcisco);
destination(allnet); };</font>
<br>
<br>
<br><font size=2 face="sans-serif">Henry -</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Balazs Scheidler &lt;bazsi@balabit.hu&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: syslog-ng-admin@lists.balabit.hu</font>
<p><font size=1 face="sans-serif">02/28/2005 11:11 AM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
syslog-ng@lists.balabit.hu</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">syslog-ng@lists.balabit.hu</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">Re: [syslog-ng]Syslog-NG
1.6.6 memory leak when sending UDP logs</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>On Mon, 2005-02-28 at 09:36 -0500, henry@shoelacecity.com
wrote:<br>
&gt; <br>
&gt; I'm running 1.6.6 on Linux Redhat ES 3.0 logging Cisco router logs
to<br>
&gt; local files and it's been running just fine for over a week. &nbsp;<br>
&gt; I just enabled &nbsp;forwarding for local4 and local7 (with spoof
UDP) &nbsp;to<br>
&gt; 2 additional hosts via UDP and noticed, within a day, that it<br>
&gt; syslog-NG has consumed all available memory. &nbsp; It continues to
log,<br>
&gt; however, the system starts killing processes off unless I restart<br>
&gt; syslog-ng. <br>
<br>
If I understand you correctly you use syslog-ng to send logs to another<br>
host via UDP. Is it a new installation or this installation has worked<br>
so far and upgrading to 1.6.6 is what triggered the problem?<br>
<br>
Are you using address spoofing (spoof-source(yes))? Can you post your<br>
configuration file?<br>
<br>
-- <br>
Bazsi<br>
<br>
<br>
_______________________________________________<br>
syslog-ng maillist &nbsp;- &nbsp;syslog-ng@lists.balabit.hu<br>
https://lists.balabit.hu/mailman/listinfo/syslog-ng<br>
Frequently asked questions at http://www.campin.net/syslog-ng/faq.html<br>
<br>
</tt></font>
<br>
--=_alternative 005A87F785256FB6_=--