Hi there, I have syslog-ng 2.0rc3 on FreeBSD 5.4.
From time to time I have problems. Syslog-ng dies with core dump.
This is output from gdb NU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"... Core was generated by `syslog-ng'. Program terminated with signal 11, Segmentation fault. #0 log_writer_broken (self=0x820e080, notify_code=3) at logpipe.h:77 77 logpipe.h: No such file or directory. in logpipe.h (gdb) where #0 log_writer_broken (self=0x820e080, notify_code=3) at logpipe.h:77 #1 0x08051199 in log_writer_fd_dispatch (source=0x81f0540, callback=0, user_data=0x0) at logwriter.c:361 #2 0x0805b7b1 in g_main_context_dispatch () #3 0x0805cb76 in g_main_context_iterate () #4 0x0805cf5b in g_main_context_iteration () #5 0x080483ac in main_loop_run (cfg=0x81f1300) at main.c:162 #6 0x08048a8c in main (argc=0, argv=0x0) at main.c:420 (gdb) In syslog-ng config I have some pipe sources. I have this problem after upgrade from 1.6 to 2.0rc3. Any ideas why I have this problem and how to fix this? -- Best regards, Sergey N. Romanov
On Sat, 2006-10-21 at 19:44 +0600, Sergey N. Romanov wrote:
Hi there,
I have syslog-ng 2.0rc3 on FreeBSD 5.4.
From time to time I have problems. Syslog-ng dies with core dump.
This is output from gdb
NU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"... Core was generated by `syslog-ng'. Program terminated with signal 11, Segmentation fault. #0 log_writer_broken (self=0x820e080, notify_code=3) at logpipe.h:77 77 logpipe.h: No such file or directory. in logpipe.h (gdb) where #0 log_writer_broken (self=0x820e080, notify_code=3) at logpipe.h:77 #1 0x08051199 in log_writer_fd_dispatch (source=0x81f0540, callback=0, user_data=0x0) at logwriter.c:361 #2 0x0805b7b1 in g_main_context_dispatch () #3 0x0805cb76 in g_main_context_iterate () #4 0x0805cf5b in g_main_context_iteration () #5 0x080483ac in main_loop_run (cfg=0x81f1300) at main.c:162 #6 0x08048a8c in main (argc=0, argv=0x0) at main.c:420 (gdb)
In syslog-ng config I have some pipe sources. I have this problem after upgrade from 1.6 to 2.0rc3.
Any ideas why I have this problem and how to fix this?
One of the leak fixes in 2.0rc2 introduced the problem, 2.0rc1 should be safe and I'm working on a solution. -- Bazsi
On Sat, 2006-10-21 at 21:42 +0200, Balazs Scheidler wrote:
On Sat, 2006-10-21 at 19:44 +0600, Sergey N. Romanov wrote:
Hi there,
I have syslog-ng 2.0rc3 on FreeBSD 5.4.
One of the leak fixes in 2.0rc2 introduced the problem, 2.0rc1 should be safe and I'm working on a solution.
I have now committed the patch below which should fix the problem (and another unrelated one I've found while testing my fix) It should be available in tomorrow's snapshot as well. --- orig/src/logwriter.c +++ mod/src/logwriter.c @@ -96,10 +96,11 @@ log_writer_fd_prepare(GSource *source, } return FALSE; } - else if (self->writer->flags & LW_DETECT_EOF) - self->pollfd.events = G_IO_HUP; else self->pollfd.events = 0; + + if (self->writer->flags & LW_DETECT_EOF) + self->pollfd.events |= G_IO_HUP | G_IO_IN; self->flush_waiting_for_timeout = FALSE; self->pollfd.revents = 0; return FALSE; @@ -130,7 +131,7 @@ log_writer_fd_dispatch(GSource *source, gpointer user_data) { LogWriterWatch *self = (LogWriterWatch *) source; - if (self->pollfd.revents & (G_IO_HUP)) + if (self->pollfd.revents & (G_IO_HUP | G_IO_IN)) { msg_error("EOF occurred while idle", evt_tag_int("fd", self->fd->fd), @@ -266,8 +267,8 @@ static void log_writer_broken(LogWriter *self, gint notify_code) { /* the connection seems to be broken */ - log_pipe_deinit(&self->super, NULL, NULL); log_pipe_notify(self->control, &self->super, notify_code, self); + log_pipe_deinit(&self->super, NULL, NULL); } static gboolean @@ -389,8 +390,6 @@ log_writer_deinit(LogPipe *s, GlobalConf g_source_unref(self->source); self->source = NULL; } - log_pipe_unref(self->control); - self->control = NULL; if (self->dropped_messages) stats_orphan_counter(SC_TYPE_DROPPED, self->options->stats_name, &self->dropped_messages); @@ -452,7 +451,6 @@ log_writer_new(guint32 flags, LogPipe *c self->queue = g_queue_new(); self->flags = flags; self->control = control; - log_pipe_ref(control); return &self->super; } -- Bazsi
Balazs Scheidler wrote:
I have now committed the patch below which should fix the problem (and another
Thanks for so fast fix! I will inform if I will have problems :-) -- Best regards, Sergey N. Romanov
Hi, Sergey N. Romanov <sr@innter.net> [20061022 15:29:49 +0600]:
Balazs Scheidler wrote:
I have now committed the patch below which should fix the problem (and another
I noticed syslog-ng was tripping over too in rc3 with a broken pipe also. Applied your patch and now the daemon has been up for 12 hours rather than the usual 30 mins... Cheers Alex ========= alex@syslog0:~$ tail syslog-ng.debug -n 20 gettimeofday({1161428393, 62130}, NULL) = 0 recvfrom(3, "<30>femon-recv[2540]: timestamp:"..., 8192, 0, {sa_family=AF_INET, sin_port=htons(1030), sin_addr=inet_addr("212.219.138.124")}, [16]) = 119 gettimeofday({1161428393, 62280}, NULL) = 0 time(NULL) = 1161428393 getsockname(3, {sa_family=AF_INET, sin_port=htons(514), sin_addr=inet_addr("239.194.253.0")}, [16]) = 0 gettimeofday({1161428393, 62455}, NULL) = 0 gettimeofday({1161428393, 62506}, NULL) = 0 poll([{fd=10, events=POLLOUT, revents=POLLOUT|POLLERR}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=4, events=POLLIN}, {fd=3, events=POLLIN, revents=POLLIN}, {fd=5, events=POLLIN}], 7, 139921) = 2 write(10, "Oct 21 11:59:53 212.219.138.124 "..., 148) = -1 EPIPE (Broken pipe) --- SIGPIPE (Broken pipe) @ 0 (0) --- time([1161428393]) = 1161428393 getpid() = 31067 gettimeofday({1161428393, 62901}, NULL) = 0 time(NULL) = 1161428393 --- SIGSEGV (Segmentation fault) @ 0 (0) --- getpid() = 31067 kill(31067, SIGSEGV) = 0 sigreturn() = ? (mask now []) --- SIGSEGV (Segmentation fault) @ 0 (0) --- Process 31067 detached ===================
Thanks for so fast fix! I will inform if I will have problems :-)
--
Best regards, Sergey N. Romanov _______________________________________________ syslog-ng maillist - syslog-ng@lists.balabit.hu https://lists.balabit.hu/mailman/listinfo/syslog-ng Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
participants (3)
-
Alexander Clouter
-
Balazs Scheidler
-
Sergey N. Romanov