Tom Donovan wrote: > > -------------8<---------- Start Bug Report ------------8<---------- > 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.
> This is similar to, but not the same as, Apache bug 43329 > http://issues.apache.org/bugzilla/show_bug.cgi?id=43329 > which concerns the APR 1.2.11 process-creation changes. > > 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. Yes; definately a different problem although a side effect of the same attempt to fix the issue. What is interesting > Failure is at line 128 in modperl_io.c > (function modperl_io_perlio_override_stdin) > -------------------------------------------------------- > modperl_io.c - in function modperl_io_perlio_override_stdin > 124 /* open my $oldout, "<&STDIN" or die "Can't dup STDIN: > 125 status = do_open(handle_save, "<&STDIN", 7, FALSE, > 126 O_RDONLY, 0, Nullfp); > 127 if (status == 0) { >>>> 128 Perl_croak(aTHX_ "Failed to dup STDIN: %" SVf, is that mod perl is attempting to protect us from ourselves even before the fixes went into win32. Of all of the adjustments in version 2.2.6, try backing out only this single effect of the patch, which closed stdin on both the parent and child, and please confirm if this alone is enough to placate mod_perl? (This would be patch -R to revert the following.) --- httpd/httpd/branches/2.2.x/server/mpm/winnt/mpm_winnt.c 2006/09/15 13:19:25 446606 +++ httpd/httpd/branches/2.2.x/server/mpm/winnt/mpm_winnt.c 2007/08/24 22:04:23 569541 @@ -1297,6 +1297,9 @@ 0, TRUE, DUPLICATE_SAME_ACCESS)) { SetStdHandle(STD_OUTPUT_HANDLE, nullstdout); } + + /* Close the original handle, we used the duplicate */ + apr_file_close(nullfile); } } } @@ -1635,6 +1638,9 @@ /* Set up the listeners */ get_listeners_from_parent(s); + + /* Done reading from the parent, close that channel */ + CloseHandle(pipe); ap_my_generation = ap_scoreboard_image->global->running_generation; }
