[syslog-ng] syslog-ng dying

Balazs Scheidler bazsi@balabit.hu
Sun, 18 Jun 2000 18:12:27 +0200


> 
> syslog-ng: io.c:172: io_iter: Assertion `i < nfds' failed.
> 
> Here's the version:
> Jun 17 11:17:06 skitzo syslog-ng[2230]: syslog-ng version 1.4.4 starting
> 
> It collects logs from 4 hosts in remote locations via tcp. When it gives
> this message it dies. I have to have a cron job right now that restarts
> syslog-ng every hour, just to make sure that it's running. 


Hi,

Try this patch against libol, recompile and check if it fixes this problem:

diff -urN libol-0.2.17/src/io.c libol-0.2.18/src/io.c
@@ -109,14 +108,7 @@
 		struct nonblocking_fd *fd;
 
 		for(fd_p = &b->files; (fd = *fd_p); ) {
-			if (fd->super.alive) {
-				if (fd->prepare) {
-					PREPARE_FD(fd);
-				} else if (fd->to_be_closed) {
-					kill_fd(fd);
-				}
-			}
-			else {
+			if (!fd->super.alive) {
 				if (fd->fd < 0)
 					/* Unlink the file object, but don't close any underlying file. */
 					;
@@ -140,7 +132,19 @@
 				*fd_p = fd->next;
 				continue;
 			}
-			nfds++;
+			fd_p = &fd->next;
+		}
+
+		for(fd_p = &b->files; (fd = *fd_p); ) {
+			if (fd->super.alive) {
+				if (fd->prepare) {
+					PREPARE_FD(fd);
+				} else if (fd->to_be_closed) {
+					kill_fd(fd);
+					continue;
+				}
+				nfds++;
+			}
 			fd_p = &fd->next;
 		}