[Bug 189] New: Syslog-ng 3.3.5. 90 segfaults with cmd line options --version and --debug
https://bugzilla.balabit.com/show_bug.cgi?id=189 Summary: Syslog-ng 3.3.5.90 segfaults with cmd line options -- version and --debug 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: jpo@di.uminho.pt Type of the Report: --- Estimated Hours: 0.0 Linux distro: Fedora 17 x86_64 Syslog-ng source tarball: syslog-ng-3.3.5.90-20120810-v3.3.5-43-g19f6c.tar.gz Summary: Using the command line options --version and --debug simultaneously causes a segmentation fault. ---------- # /usr/sbin/syslog-ng --version --debug syslog-ng 3.3.5.90 Installer-Version: 3.3.5.90 Revision: Compile-Date: Aug 20 2012 05:49:44 Default-Modules: affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat,afsql Segmentation fault (core dumped) ---------- # gdb /usr/sbin/syslog-ng core.1065 GNU gdb (GDB) Fedora (7.4.50.20120120-49.fc17) Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /usr/sbin/syslog-ng...Reading symbols from /usr/lib/debug/usr/sbin/syslog-ng.debug...done. done. [New LWP 1065] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `/usr/sbin/syslog-ng --version --debug'. Program terminated with signal 11, Segmentation fault. #0 nv_registry_get_handle_name (length=0x7ffff9f5a1c8, handle=4, self=<optimized out>) at nvtable.h:86 86 stored = &g_array_index(self->names, NVHandleDesc, handle - 1); (gdb) backtrace #0 nv_registry_get_handle_name (length=0x7ffff9f5a1c8, handle=4, self=<optimized out>) at nvtable.h:86 #1 log_msg_get_value_name (handle=handle@entry=4, name_len=name_len@entry=0x7ffff9f5a1c8) at logmsg.c:305 #2 0x00007f52258d8bea in log_msg_set_value (self=self@entry=0xe7da00, handle=handle@entry=4, value=value@entry=0x7f522590069b "syslog-ng", value_len=value_len@entry=9) at logmsg.c:458 #3 0x00007f52258da937 in log_msg_new_internal (prio=47, msg=0xe7cfa0 "Trying to open module; module='dummy', filename='//usr/lib64/syslog-ng/libdummy.so'") at logmsg.c:1128 #4 0x00007f52258e7703 in msg_send_internal_message (prio=<optimized out>, msg=<optimized out>) at messages.c:141 #5 0x00007f52258e78d0 in msg_event_send (e=0xe7cf30) at messages.c:179 #6 0x00007f52258eb825 in plugin_dlopen_module (module_name=module_name@entry=0xe72560 "dummy", module_path=0x7f522590068f "//usr/lib64/syslog-ng") at plugin.c:188 #7 0x00007f52258ebf73 in plugin_list_modules (out=0x7f52240d3260, verbose=verbose@entry=0) at plugin.c:293 #8 0x00000000004018a4 in version () at main.c:134 #9 0x000000000040163c in main (argc=1, argv=0x7ffff9f5a488) at main.c:217 (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=189 Tamás Pál <folti@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |folti@balabit.hu --- Comment #1 from Tamás Pál <folti@balabit.hu> 2012-08-21 11:56:31 --- syslog-ng's internal message handling system is uninitialized, that's what causes the segfault. The following patch will fix it: --- a/syslog-ng/main.c +++ b/syslog-ng/main.c @@ -212,11 +212,13 @@ main(int argc, char *argv[]) if (display_version) { + msg_init(TRUE) version(); return 0; } if (display_module_registry) { + msg_init(TRUE) plugin_list_modules(stdout, TRUE); return 0; } -- 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=189 --- Comment #2 from Jose Oliveira <jpo@di.uminho.pt> 2012-08-21 13:32:53 --- (In reply to comment #1)
syslog-ng's internal message handling system is uninitialized, that's what causes the segfault. The following patch will fix it:
--- a/syslog-ng/main.c +++ b/syslog-ng/main.c @@ -212,11 +212,13 @@ main(int argc, char *argv[])
if (display_version) { + msg_init(TRUE) version(); return 0; } if (display_module_registry) { + msg_init(TRUE) plugin_list_modules(stdout, TRUE); return 0; }
I'm still getting segmentation faults with the above patch [1]. /jpo [1] - The above patch is missing a couple of semicolons. -- 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=189 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |3.3.7 CC| |algernon@balabit.hu AssignedTo|bazsi@balabit.hu |algernon@balabit.hu -- 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=189 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- 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=189 --- Comment #3 from Gergely Nagy <algernon@balabit.hu> 2012-09-01 12:59:22 --- The problem here is, that at that point, we should call msg_init(TRUE), as Folti said. But there's an msg_init(FALSE) prior to that, so a later msg_init(TRUE) will have no effect. -- 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=189 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution| |FIXED Status|ASSIGNED |RESOLVED --- Comment #4 from Gergely Nagy <algernon@balabit.hu> 2012-09-01 13:08:23 --- I removed the bogus msg_init(FALSE), and applied Folti's fix, problem's gone. Pushed to 3.3's master, marking as fixed. -- 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