Tom Donovan wrote:
> Michael Lackhoff wrote:
>> On 23.12.37378 20:59 Tom Donovan wrote:
>>
>>> 1. Problem Description:
>>>
>>>   perl-script handler fails with Apache 2.2.6 on Windows
>>>   due to changes in stdin/stdout/stderr handles in mpm_winnt
>>>
>>>   Problem occurs with mod_perl 2.0.3 or with
>>>      current (9/14/2007) SVN trunk.
>>
>> I noticed the same problem with Apache 2.0.61.

This is consistent at least.  In fact the same changes were applied
to both.

>>>   This problem can be avoided if \server\mpm\winnt\mpm_winnt.c
>>>   from Apache 2.2.4 is used - even with APR 1.2.11.
>>>   Note that server\log.c line 411 also needs to be changed to
>>>   work with this older mpm_winnt.
>>
>> I would like to try this but since I am not a C programmer, can you say
>> what the changed line in log.c should look like?
>> And is there a similar fix for 2.0.61? I would prefer to stay with the
>> 2.0.x branch for the time being.
>>
>> - Michael
> 
> The change I made in 2.2.6 was to line 411 in server\log.c
> --------------------------------------
> CHANGED:
> 
>     rv = apr_file_dup2(stderr_log, s_main->error_log, stderr_p);
> 
> TO:
> 
>     if (stderr_log)
>         rv = apr_file_dup2(stderr_log, s_main->error_log, stderr_p);
>     else
>         rv = apr_file_dup(&stderr_log, s_main->error_log, stderr_p);
> --------------------------------------
> 
> Note the '&' character before 'stderr_log' in the call to apr_file_dup.
>  This differs from the call to apr_file_dup2, and it's easy to miss.

Yes, of course.  However in the second case, you do not have an inheritable
file handle.  apr_file_dup simply dups the handle in the current process,
so the patch can't possibly have the desired effect.

There is a real concern; under what conditions would stderr_log not be
initialized.  *therein* lies the bug.

> The line to change in server\log.c for version 2.0.61 is line 413.
> You must also replace server\mpm\winnt\mpm_winnt.c with the one from
> Apache 2.0.59.  I haven't tried this with Apache 2.0 and AFAIK nobody
> else has, so please test carefully.
> 
> Also note that this reverses the changes which improved piped logging
> for 2.2.6 (2.0.61).

And, I believe, breaks piped logging processes again, although this would
be noticed in 2.2.6 not 2.0.61, because we launch a pipe log process in
2.0, while we launch a pipe log cmd shell in 2.2.

Reply via email to