You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@attglobal.net> on 2003/09/05 13:15:57 UTC

Re: 1.3.28 alloc.c patch to CVS tree not working

I didn't work up or commit that exact patch; I just noticed that a patch 
was finally committed so I closed the PR.  But I plead guilty to sharing 
some of the thoughts behind the part of the patch that may be failing on 
your box.  The issue with Ralf's patch, which is perhaps unavoidable in 
a portable manner, is that it always waits at least a tiny amount of 
time even if the process has already exited.  We wanted to avoid that, 
but to do so we relied on a behavior that has turned out to be 
unportable, failing on at least Tru64 and Mac OS X.

 From your notes, it looks like you properly built in the changes.  I'll 
update the bugzilla entry with your report of failure on Tru64.  The 
code will be fixed before long.  And thanks for trying it out.

You may wish to look over the latest comments to the PR at

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21737

Take care,

Jeff

Richard Jackson wrote:
> Jeff Trawick,
> 
> I applied and tested the patch you checked in 9/2/2003
> 
> diff -c alloc.c.20030904 alloc.c.20030904a
> *** alloc.c.20030904    Thu Sep  4 12:10:42 2003
> --- alloc.c.20030904a   Thu Sep  4 12:12:37 2003
> ***************
> *** 3096,3107 ****
>         if ((p->kill_how == kill_after_timeout)
>             || (p->kill_how == kill_only_once)) {
>             /* Subprocess may be dead already.  Only need the timeout if not. */
> !           if (ap_os_kill(p->pid, SIGTERM) == -1) {
>                   p->kill_how = kill_never;
> !             }
> !             else {
>                 need_timeout = 1;
> -             }
>         }
>         else if (p->kill_how == kill_always) {
>             kill(p->pid, SIGKILL);
> --- 3096,3105 ----
>         if ((p->kill_how == kill_after_timeout)
>             || (p->kill_how == kill_only_once)) {
>             /* Subprocess may be dead already.  Only need the timeout if not. */
> !           if ( (ap_os_kill(p->pid, SIGTERM) == -1) && (errno == ESRCH) )
>                   p->kill_how = kill_never;
> !             else
>                 need_timeout = 1;
>         }
>         else if (p->kill_how == kill_always) {
>             kill(p->pid, SIGKILL);
> 
> Still left defunct processes on our Tru64 UNIX 5.1A system.  I assume after
> changing the alloc.c file, performing a make and copy httpd into place is
> sufficient...
> 
> . cd /usr/local/src/apache_1.3.28
> . cp -p src/main/alloc.c src/main/alloc.c.20030904
> . modify src/main/alloc.c
> . make >& make.log2 &
> . strip src/httpd
> . cp -p src/httpd /usr/local/apache/bin/httpd.new
> . cd /usr/local/apache/bin
> . (mv httpd httpd.20030904;mv httpd.new httpd)
> . /sbin/init.d/https-apache stop
> . /sbin/init.d/https-apache start
> 
> Since the above patch did not work, I tried the patch suggested by Ralf
> Engelschall,
> http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=105952652425849&w=2
> 
> diff -c alloc.c.20030904 alloc.c
> *** alloc.c.20030904    Thu Sep  4 12:10:42 2003
> --- alloc.c     Thu Sep  4 14:22:35 2003
> ***************
> *** 3096,3107 ****
>         if ((p->kill_how == kill_after_timeout)
>             || (p->kill_how == kill_only_once)) {
>             /* Subprocess may be dead already.  Only need the timeout if not. */
> !           if (ap_os_kill(p->pid, SIGTERM) == -1) {
> !                 p->kill_how = kill_never;
> !             }
> !             else {
> !               need_timeout = 1;
> !             }
>         }
>         else if (p->kill_how == kill_always) {
>             kill(p->pid, SIGKILL);
> --- 3096,3103 ----
>         if ((p->kill_how == kill_after_timeout)
>             || (p->kill_how == kill_only_once)) {
>             /* Subprocess may be dead already.  Only need the timeout if not. */
> !             ap_os_kill(p->pid, SIGTERM);
> !             need_timeout = 1;
>         }
>         else if (p->kill_how == kill_always) {
>             kill(p->pid, SIGKILL);
> 
> Since I have been using Ralf's patch, I have not had a single defunct process.
>