[syslog-ng] Memory leak reintroduced in 3.3.3.

Gergely Nagy algernon at balabit.hu
Fri Mar 30 16:12:48 CEST 2012


Jakub Jankowski <shasta at toxcorp.com> writes:

> I'm pretty sure this particular memory leak was fixed in 3.3.2,
> but then got reintroduced in this commit:
> http://git.balabit.hu/?p=bazsi/syslog-ng-3.3.git;a=commitdiff;h=c7070e2a6f1c3a312260bcecf49d62028fef27ce
> which was done to fix tcp() destination related crash after 3.3.2 was released.
>
> So, Bazsi, yes - it does reintroduce the leak :) (in reply to your comment in
> https://lists.balabit.hu/pipermail/syslog-ng/2011-November/017697.html )

I think I found the solution: the reason for the crash in afsocket,
which Bazsi fixed with killing the log_queue_unref in lib/driver.h was
that it was missing a log_queue_ref. We didn't unref more than we
should, we reffed less!

While I don't entirely understand the call chain, comparing how affile
and afsocket did their queue magic, I prepared a patch that does not
crash afsocket on reload, and stops the leak aswell. It also looks
sane-ish to me, so I'm reasonably sure it's fine.

The patch is attached, I tested it as much as I could: no crash, no
leak, no empty files. If you could test it too, it would be most
appreciated!

-- 
|8]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-afsocket-Properly-release-our-queue-at-deinit.patch
Type: text/x-diff
Size: 0 bytes
Desc: not available
Url : http://lists.balabit.hu/pipermail/syslog-ng/attachments/20120330/288b7aeb/attachment.patch 


More information about the syslog-ng mailing list