httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject [PATCH] PR#1107: defend against linux select EFAULT
Date Sat, 13 Sep 1997 05:33:12 GMT
There's a dozen PRs about this and we really do think it's the kernel... 
but this does appear to be one way to work around it:  kill off the child
that gets stuck in an EFAULT select loop.

For 1.3 and 1.2 (with the appropriate logging change). 

Dean

Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
retrieving revision 1.221
diff -u -r1.221 http_main.c
--- http_main.c	1997/09/12 21:48:36	1.221
+++ http_main.c	1997/09/13 05:29:36
@@ -2851,8 +2851,18 @@
 		memcpy(&main_fds, &listenfds, sizeof(fd_set));
 		srv = ap_select(listenmaxfd+1, &main_fds, NULL, NULL, NULL);
 
-		if (srv < 0 && errno != EINTR)
+		if (srv < 0 && errno != EINTR) {
+#ifdef LINUX
+		    if (errno == EFAULT) {
+			aplog_error(APLOG_MARK, APLOG_ERR, server_conf,
+			    "select: (listen) fatal, exiting");
+			child_exit_modules (pconf, server_conf);
+			destroy_pool(pconf);
+			exit(1);
+		    }
+#endif
 		    aplog_error(APLOG_MARK, APLOG_ERR, server_conf, "select: (listen)");
+		}
 		
 		if (srv <= 0)
 		    continue;



Mime
View raw message