Skip to content

Conversation

@trawick
Copy link

@trawick trawick commented Dec 1, 2013

This fixes a problem found with php-cgi.exe on Windows; it wouldn't terminate when httpd was stopped.

The root cause was:

  • PHP doesn't respond to the termination event set by mod_fastcgi (this is a
    feature of the FastCGI programming library provided by the mod_fastcgi folks,
    which PHP apparently does not use).
  • The Windows code was broken in that it wouldn't forcibly kill after sleeping
    if it had previously tried to set the termination event, due to confusionf
    about state (modified by the patch). Even if the child_wait thread was
    running, it wouldn't have changed the state from VICTIM.

Hmmm... Before trying to fix it I couldn't find anything useful with a web
search but after arriving at a solution I found the same one here:

http://mailman.fastcgi.com/pipermail/fastcgi-developers/2009-October/000365.html

…erminate

when httpd was stopped.

The root cause was:

* PHP doesn't respond to the termination event set by mod_fastcgi (this is a
  feature of the FastCGI programming library provided by the mod_fastcgi folks,
  which PHP apparently does not use).

* The Windows code was broken in that it wouldn't forcibly kill after sleeping
  if it had previously tried to set the termination event, due to confusionf
  about state (modified by the patch).  Even if the child_wait thread was
  running, it wouldn't have changed the state from VICTIM.

Hmmm...  Before trying to fix it I couldn't find anything useful with a web
search but after arriving at a solution I found the same one here:

http://mailman.fastcgi.com/pipermail/fastcgi-developers/2009-October/000365.html
patch, the module id ("fastcgi") was only available for messages
logged from mod_fastcgi.c.  For messages logged from other files,
the id would be unavailable for logging *and* module-specific
log levels would not take affect.

Part of the original patch has been removed -- the use of
AP_DECLARE_MODULE(fastcgi) -- because it wasn't sufficient for
providing a module id when logging from source files other than
that one, and it interfered with the real fix (APLOG_USE_MODULE).
@allardhoeve
Copy link
Contributor

Hey there,

Thanks for the patch. I'll take a look tomorrow.

I do not run Apache 2.4 on Windows, so cannot test. But I can test on Linux.

The patch does look good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants