[syslog-ng] [Bug 183] Threaded Syslog-ng chashes resolving locally

bugzilla at bugzilla.balabit.com bugzilla at bugzilla.balabit.com
Fri Jun 8 15:40:29 CEST 2012


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


Gergely Nagy <algernon at balabit.hu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|                            |FIXED
             Status|ASSIGNED                    |RESOLVED




--- Comment #3 from Gergely Nagy <algernon at balabit.hu>  2012-06-08 15:40:29 ---
Ok, for further reference, here's what happens: the main loop will init/destroy the DNS cache when worker threads start and stop, which would be fine, since
all the dns cache variables are thread local. Except, dns_cache_destroy() also frees dns_cache_hosts, which is NOT thread local, but a global static. This
results in memory corruption.

Triggering the problem is trivial, too: set use_dns(persist_only) and dns_cache_hosts(/etc/hosts) along with threaded(yes) in the config, and
dns_cache_expire(5) too. Send a log, disconnect, wait a few seconds for the worker thread to stop, connect again, and watch it blow up in a segfault.

The solution is very simple: stop freeing dns_cache_host in dns_cache_destroy(), and introduce a dns_cache_deinit() function to do that, which is called when
syslog-ng shuts down.

I just applied a fix to the 3.3 branch[1] that does that, so this issue will be fixed in 3.3.6. Thanks for the report!

 [1]: http://git.madhouse-project.org/debian/syslog-ng/patch/?id=c0afec5b46eb3508fd3b1449e37b7e550f7d35e2


-- 
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