[syslog-ng] [Bug 208] New: Memory leak when enabling debug logging

bugzilla at bugzilla.balabit.com bugzilla at bugzilla.balabit.com
Fri Oct 26 16:02:20 CEST 2012


https://bugzilla.balabit.com/show_bug.cgi?id=208

           Summary: Memory leak when enabling debug logging
           Product: syslog-ng
           Version: 3.3.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: unspecified
         Component: syslog-ng
        AssignedTo: bazsi at balabit.hu
        ReportedBy: koldaevav at gmail.com
Type of the Report: bug
   Estimated Hours: 0.0


syslog-ng, all default configuration

root at test-syslog-02:~# uname -a
Linux test-syslog-02 2.6.32-44-server #98-Ubuntu SMP Mon Sep 24 17:41:33 UTC 2012 x86_64 GNU/Linux

root at test-syslog-02:~# cat /etc/issue
Ubuntu 10.04.4 LTS \n \l

root at test-syslog-02:~# dpkg -l | grep syslog
ii  libsyslog-ng-3.3.6              3.3.6-1~mhp1~lucid                Next generation system logging daemon (private librar
ii  libsyslog-ng-3.3.6.91           3.3.6.91-1~mhp1~lucid             Next generation system logging daemon (private librar
ii  syslog-ng                       3.3.6.91-1~mhp1                   Next generation system logging daemon (metapackage)
ii  syslog-ng-core                  3.3.6.91-1~mhp1~lucid             Next generation system logging daemon (core)
ii  syslog-ng-mod-json              3.3.6.91-1~mhp1~lucid             Next generation system logging daemon (JSON plugin)
ii  syslog-ng-mod-mongodb           3.3.6.91-1~mhp1~lucid             Next generation system logging daemon (MongoDB plugin
ii  syslog-ng-mod-sql               3.3.6.91-1~mhp1~lucid             Next generation system logging daemon (SQL plugin)

root at test-syslog-02:~# syslog-ng-ctl debug --set=on && strace -f -c -p `pgrep -f '/usr/sbin/syslog-ng'`
Process 30701 attached with 2 threads - interrupt to quit
Process 30704 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.150000       16667         9           epoll_wait
  0.00    0.000000           0         2           read
  0.00    0.000000           0         5           write
  0.00    0.000000           0         2           close
  0.00    0.000000           0     22129           brk
  0.00    0.000000           0         1           madvise
  0.00    0.000000           0         1           accept
  0.00    0.000000           0         1           setsockopt
  0.00    0.000000           0         4           fcntl
  0.00    0.000000           0         3           futex
  0.00    0.000000           0         4           epoll_ctl
------ ----------- ----------- --------- --------- ----------------
100.00    0.150000                 22161           total

It uses all available memory and swap, and being killed by oom_killer:
Oct 26 13:44:24 test-syslog-02 kernel: : [107460.493074] Out of memory: kill process 30701 (syslog-ng) score 186140 or a child
Oct 26 13:44:24 test-syslog-02 kernel: : [107460.648697] Killed process 30701 (syslog-ng)

root at test-syslog-02:~# syslog-ng-ctl debug --set=on; strace -f -o ./syslog-ng.strace.log -p `pgrep -f '/usr/sbin/syslog-ng'`
root at test-syslog-02:~# grep -v brk ./syslog-ng.strace.log
31364 epoll_wait(18,  <unfinished ...>
31365 epoll_wait(21,  <unfinished ...>
31365 <... epoll_wait resumed> {}, 1, 3194) = 0
31364 <... epoll_wait resumed> {}, 1, 3193) = 0
31365 epoll_ctl(21, EPOLL_CTL_DEL, 22, {0, {u32=3357993160, u64=139959162300616}} <unfinished ...>
31364 futex(0x7f4ac813fc20, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
31365 <... epoll_ctl resumed> )         = 0
31365 close(22)                         = 0
31365 futex(0x7f4ac813fc20, FUTEX_WAKE_PRIVATE, 1) = 1
31364 <... futex resumed> )             = 0
31365 close(21 <unfinished ...>
31364 epoll_ctl(18, EPOLL_CTL_DEL, 19, {0, {u32=3357942664, u64=139959162250120}} <unfinished ...>
31365 <... close resumed> )             = 0
31364 <... epoll_ctl resumed> )         = 0
31365 write(6, "\1\0\0\0\0\0\0\0", 8 <unfinished ...>
31364 close(19 <unfinished ...>
31365 <... write resumed> )             = 8
31364 <... close resumed> )             = 0
31365 madvise(0x7f4ac1b9c000, 8359936, MADV_DONTNEED <unfinished ...>
31364 futex(0x7f4ac813fc20, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
31365 <... madvise resumed> )           = 0
31364 <... futex resumed> )             = 0
31365 _exit(0)                          = ?
31364 close(18)                         = 0
31364 write(6, "\1\0\0\0\0\0\0\0", 8)   = 8
31364 madvise(0x7f4ac239d000, 8359936, MADV_DONTNEED) = 0
31364 _exit(0)                          = ?
31362 +++ killed by SIGKILL +++


I'll be happy to provide any additional info you need.

I'm not able to debug my syslog-ng problems because if this bug.


-- 
Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the syslog-ng mailing list