[Bug 141] New: Crash while reloading config
https://bugzilla.balabit.com/show_bug.cgi?id=141 Summary: Crash while reloading config Product: syslog-ng Version: 3.3.x Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: unspecified Component: syslog-ng AssignedTo: bazsi@balabit.hu ReportedBy: eric@sevenscale.com Type of the Report: --- Estimated Hours: 0.0 We have experienced multiple instances of crashes on reloading a config with 3.3.1. Here is the backtrace: (gdb) where #0 afsocket_sd_remove_and_kill_connection (self=0x0, connection=0x1d64010) at afsocket.c:343 #1 0x00007f3b91790560 in afsocket_sd_kill_connection_list (list=<value optimized out>) at afsocket.c:367 #2 0x00007f3b9225a4f2 in persist_config_entry_free (self=0x1eb9180) at cfg.c:66 #3 0x0000003b62a2dd3e in ?? () from /lib64/libglib-2.0.so.0 #4 0x0000003b62a2e1ad in g_hash_table_remove_all () from /lib64/libglib-2.0.so.0 #5 0x0000003b62a2e245 in g_hash_table_destroy () from /lib64/libglib-2.0.so.0 #6 0x00007f3b9225a78c in persist_config_free (self=0x35de9e0) at cfg.c:83 #7 0x00007f3b922730d4 in main_loop_reload_config_apply () at mainloop.c:491 #8 0x00007f3b9228f81b in iv_signal_event (_this=0x7f3b924bbee0) at iv_signal.c:80 #9 0x00007f3b9228f3a9 in iv_event_raw_got_event (_this=0x7f3b924bbf08) at iv_event_raw.c:82 #10 0x00007f3b9228cdf6 in iv_run_active_list () at iv_main.c:219 #11 iv_main () at iv_main.c:269 #12 0x00007f3b92272c3e in main_loop_run () at mainloop.c:722 #13 0x00000000004015b1 in main () (gdb) p *connection $5 = {super = {ref_cnt = {counter = 2}, flags = 0, cfg = 0x0, pipe_next = 0x1a2e5b0, queue_data = 0x0, queue = 0, init = 0x7f3b917901b0 <afsocket_sc_init>, deinit = 0x7f3b91790470 <afsocket_sc_deinit>, free_fn = 0x7f3b9178fc60 <afsocket_sc_free>, notify = 0x7f3b91790570 <afsocket_sc_notify>}, owner = 0x0, reader = 0x1d64430, sock = 386, peer_addr = 0x0} (gdb) -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=141 --- Comment #1 from Balazs Scheidler <bazsi@balabit.hu> 2011-10-26 16:06:23 --- Did you perhaps remove the tcp() source definition from your configuration while reloading? I think that's the culprit, I got a similar looking backtrace using the steps: 1) start syslog-ng, open a connection to the tcp() source 2) remove the source in the configuration file but keeping the connection open 3) SIGHUP the syslog-ng process Program received signal SIGSEGV, Segmentation fault. 0x00007ffff5622a23 in afsocket_sd_remove_and_kill_connection (self=0x0, connection=0x61d680) at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/modules/afsocket/afsocket.c:343 343 self->connections = g_list_remove(self->connections, connection); (gdb) bt #0 0x00007ffff5622a23 in afsocket_sd_remove_and_kill_connection (self=0x0, connection=0x61d680) at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/modules/afsocket/afsocket.c:343 #1 0x00007ffff5622abe in afsocket_sd_kill_connection_list (list=0x641260) at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/modules/afsocket/afsocket.c:367 #2 0x00007ffff7b6214d in persist_config_entry_free (self=0x647c00) at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/lib/cfg.c:66 #3 0x00007ffff706dffa in g_hash_nodes_destroy (hash_node=0x621280, key_destroy_func=0x7ffff7082dc0 <IA__g_free>, value_destroy_func=0x7ffff7b62120 <persist_config_entry_free>) at ghash.c:874 #4 0x00007ffff706e3d7 in IA__g_hash_table_remove_all (hash_table=0x60a200) at ghash.c:483 #5 0x00007ffff706e5b5 in IA__g_hash_table_destroy (hash_table=0x0) at ghash.c:224 #6 0x00007ffff7b621c6 in persist_config_free (self=0x61d360) at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/lib/cfg.c:83 #7 0x00007ffff7b832b5 in main_loop_reload_config_apply () at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/lib/mainloop.c:491 #8 0x00007ffff7b83168 in main_loop_io_worker_sync_call (func=0x7ffff7b8320b <main_loop_reload_config_apply>) at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/lib/mainloop.c:443 #9 0x00007ffff7b83528 in main_loop_reload_config_initiate () at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/lib/mainloop.c:561 #10 0x00007ffff7b83584 in sig_hup_handler (s=0x0) at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/lib/mainloop.c:594 #11 0x00007ffff5e61dcb in iv_signal_event (_this=<value optimized out>) at iv_signal.c:80 #12 0x00007ffff5e61569 in iv_event_raw_got_event (_this=0x7ffff7ddb408) at iv_event_raw.c:82 #13 0x00007ffff60677b6 in iv_run_active_list () at iv_main.c:219 #14 iv_main () at iv_main.c:269 #15 0x00007ffff7b83967 in main_loop_run () at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/lib/mainloop.c:722 #16 0x0000000000401929 in main (argc=1, argv=0x7fffffffdaf8) at /home/bazsi/zwa/work/syslog-ng-ose-3.3/syslog-ng-ose/syslog-ng/main.c:260 -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=141 --- Comment #2 from Eric Lindvall <eric@sevenscale.com> 2011-10-26 19:13:05 --- It's very likely we removed a tcp() source definition with an open connection. Thanks for tracking this down. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=141 Balazs Scheidler <bazsi@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution| |FIXED Status|NEW |RESOLVED --- Comment #3 from Balazs Scheidler <bazsi@balabit.hu> 2011-10-27 17:41:51 --- This patch should fix it. commit 16427b9a419146b316f6e39d6d4ca7495dcf1b8a Author: Balazs Scheidler <bazsi@balabit.hu> Date: Thu Oct 27 17:33:58 2011 +0200 afsocket: fixed a NULL deref in case of reload If syslog-ng is reloaded, and the new config removes a tcp() source, and a connection is still alivem, it would segfault. Reported-By: Eric Lindvall <eric@sevenscale.com> Cc: syslog-ng-stable@balabit.hu Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla@bugzilla.balabit.com