You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Shoichi Sakane <sa...@kame.net> on 2002/07/12 05:00:27 UTC

[PATCH?] SSI by mod_cgid.c, child process becomes zombie.

when i get a html file including a line "<!--#exec cmd="ls" -->",
a child process of cgi daemon process in the server becomes zombie.
i'm using FreeBSD4.6-RELEASE and apache-2.0.39.

cgid_server() calls apr_signal(SIGCHLD, SIG_IGN), but it doesn't work
at least in my environment.  i might be misoperating, anyway the patch
is attached in this mail.  i haven't care about the porting issue.
so if this patch needs to modify to be suitable for other platform.

i'm sorry if this issue has been already discussed.
thank you.

*** mod_cgid-old.c	Fri Jun 14 04:41:17 2002
--- mod_cgid.c	Wed Jul 10 21:38:02 2002
***************
*** 514,520 ****
--- 514,537 ----
  
      apr_pool_create(&ptrans, pcgi); 
  
+ #if 0
      apr_signal(SIGCHLD, SIG_IGN); 
+ #else
+     /*
+      * parent should ignore the signal from child
+      * OR parent process has to wait for child process.
+      */
+     {
+         struct sigaction sa;
+         
+         memset(&sa, 0, sizeof(sa));
+         sa.sa_handler = NULL;
+         sa.sa_flags = SA_NOCLDWAIT;
+         sigemptyset(&sa.sa_mask);
+         sigaction(SIGCHLD, &sa, (struct sigaction *)0);
+     }
+ #endif
+ 
      apr_signal(SIGHUP, daemon_signal_handler);
  
      if (unlink(sconf->sockname) < 0 && errno != ENOENT) {

Re: [PATCH?] SSI by mod_cgid.c, child process becomes zombie.

Posted by Shoichi Sakane <sa...@kame.net>.
> when i get a html file including a line "<!--#exec cmd="ls" -->",
> a child process of cgi daemon process in the server becomes zombie.
> i'm using FreeBSD4.6-RELEASE and apache-2.0.39.

> cgid_server() calls apr_signal(SIGCHLD, SIG_IGN), but it doesn't work
> at least in my environment.  i might be misoperating, anyway the patch
> is attached in this mail.  i haven't care about the porting issue.
> so if this patch needs to modify to be suitable for other platform.

here is additional information.  i have checked if SSI "exec cmd"
works fine.

signal(SIGCHLD, SIG_IGN) is enough not to make zombie child.
	SunOS bahamas 5.7 i386

signal(SIGCHLD, SIG_IGN) makes zombie child.
	FreeBSD 4.6-RELEASE i386
	FreeBSD 3.5.1-RELEASE i386
	NetBSD 1.6_BETA4 i386
	Linux 2.4.18 i386