Bug 23533

Summary: No such process: cgid daemon is gone; is Apache terminating?
Product: Apache httpd-2 Reporter: David Boldt <dboldt>
Component: mod_cgiAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: CLOSED DUPLICATE    
Severity: major    
Priority: P3    
Version: 2.0.47   
Target Milestone: ---   
Hardware: Sun   
OS: Solaris   
URL: http://water.usgs.gov/

Description David Boldt 2003-09-30 21:36:09 UTC
Solaris 8

Server version: Apache/2.0.47
Server built:   Jul 21 2003 00:32:49
Server's Module Magic Number: 20020903:4
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/worker"
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_PROC_PTHREAD_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/opt/apache"
 -D SUEXEC_BIN="/usr/opt/apache/bin/suexec"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

Compiled in modules:
  core.c
  mod_access.c
  mod_auth.c
  mod_include.c
  mod_log_config.c
  mod_logio.c
  mod_setenvif.c
  worker.c
  http_core.c
  mod_mime.c
  mod_autoindex.c
  mod_cgid.c
  mod_negotiation.c
  mod_dir.c
  mod_userdir.c
  mod_alias.c
  mod_rewrite.c
  mod_so.c

Web site routes all HTML documents through a parsing program written in Perl,
(written before php was born, for similar reasons).  

       Action text/html /cgi-bin/h2o.cgi
       Action text/html;charset=iso-8859-1 /cgi-bin/h2o.cgi

The site receives an average of roughly 300K hits per day, and roughly every
other day CGI processing crashes with messages such as these (messages trimmed
to one per crash):

water.usgs.gov-error_log-2003-09-10:[Wed Sep 10 14:47:21 2003] [error] [client
66.123.2.43] (3)No such process: cgid daemon is gone; is Apache terminating?:
/afs/usgs.gov/www/water/cgi-bin/lookup/get, referer:
http://pubs.water.usgs.gov/TWRI3A18/
water.usgs.gov-error_log-2003-09-12:[Fri Sep 12 20:36:37 2003] [error] [client
68.211.74.103] (3)No such process: cgid daemon is gone; is Apache terminating?:
/afs/usgs.gov/www/water/cgi-bin/h2o.cgi
water.usgs.gov-error_log-2003-09-14:[Sun Sep 14 22:57:22 2003] [error] [client
216.88.158.142] (3)No such process: cgid daemon is gone; is Apache terminating?:
/afs/usgs.gov/www/water/cgi-bin/h2o.cgi
water.usgs.gov-error_log-2003-09-16:[Tue Sep 16 04:10:50 2003] [error] [client
218.5.149.36] (3)No such process: cgid daemon is gone; is Apache terminating?:
/afs/usgs.gov/www/water/cgi-bin/h2o.cgi
water.usgs.gov-error_log-2003-09-28:[Sun Sep 28 16:13:10 2003] [error] [client
65.81.33.33] (3)No such process: cgid daemon is gone; is Apache terminating?:
/afs/usgs.gov/www/water/cgi-bin/h2o.cgi
water.usgs.gov-error_log-2003-09-29:[Mon Sep 29 10:54:20 2003] [error] [client
66.196.72.14] (3)No such process: cgid daemon is gone; is Apache terminating?:
/afs/usgs.gov/www/water/cgi-bin/pointinhuc.pl
water.usgs.gov-error_log-2003-09-29:[Mon Sep 29 13:30:58 2003] [error] [client
64.68.82.143] (3)No such process: cgid daemon is gone; is Apache terminating?:
/afs/usgs.gov/www/water/cgi-bin/h2o.cgi
water.usgs.gov-error_log-2003-09-29:[Mon Sep 29 13:30:59 2003] [error] [client
130.11.160.96] (3)No such process: cgid daemon is gone; is Apache terminating?:
/www/errors/include/bottom.html, referer: http://water.usgs.gov/usgs/wrd_table.html
water.usgs.gov-error_log-2003-09-29:[Mon Sep 29 13:31:00 2003] [error] [client
64.68.82.170] (3)No such process: cgid daemon is gone; is Apache terminating?:
/afs/usgs.gov/www/water/cgi-bin/h2o.cgi

Since all web pages filter through CGI, this effectively crashes the site.
Comment 1 Jeff Trawick 2003-10-10 12:31:41 UTC
Resolving the problem that caused the cgid daemon to exit:

The upcoming 2.0.48 resolves one particular bug that can cause the cgid daemon
to exit on Solaris.  Please let us know after moving to 2.0.48 whether or not
the cgid daemon still exits intermittently.

Recovering after such a problem:

The patch below causes the cgid daemon to restart automatically after such a
problem.  The patch has been committed to Apache 2.1-dev but not yet merged into
the stable tree because it relies on a behavior specific to the worker MPM.  I
would not hesitate to use the patch on Solaris with the worker MPM though.  This
should resolve the long-term affects of whatever problem causes the cgid daemon
to exit.

http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/generators/mod_cgid.c.diff?r1=1.151&r2=1.152
Comment 2 Joel Parramore 2003-10-29 12:54:00 UTC
Should that patch be used on top of 2.0.48, or is that change already in 
2.0.48?
Comment 3 Jeff Trawick 2003-10-29 13:00:46 UTC
The patch is still not in stable branch (2.0.x) because it has an inappropriate
dependency on some behavior of the worker MPM.

If you can't get the patch to apply to the latest mod_cgid from stable branch,
let me know and I'll post a new one.
Comment 4 Jeff Trawick 2003-12-13 22:28:04 UTC
patch pointed to previously is still appropriate for use with stable branch

this problem was fixed in Apache 2.1-dev some time back with PR 19849, but a
couple of issues prevented it from being merged into stable branch...  those are
now resolved, so hopefully the fix can appear in a 2.0 release before too
terribly long


*** This bug has been marked as a duplicate of 19849 ***