You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Bill Stoddard <st...@raleigh.ibm.com> on 1999/01/29 18:03:30 UTC

16 bit CGIs on NT

After months off, I've finally started back working on the patch to
retrieve script interpreters out of the Win32 registry (configurable).
I'm trying to knock out some of the reported CGI PRs in the process, and
I've run into a problem with 16 bit CGIs. 

16bit CGIs fail -intermittently-. In the failure case, the
CreateProcess() call (in util_script.c) is successful, but all the
fields in the PROCESS_INFORMATION structure (pid, thread handle, etc.)
are NULL or 0. 

mod_cgi is failing the request because of the pid being 0. I added WIN32
specific code to accept a 0 PID. Now the ReadFile() in buff.c is
blocking. 

I've made two interesting observations:
Observation 1:
The CGI script is name is test16.exe. If I request (via the browser)
cgi-bin/test16, I never see the problem. In this case, Apache intuits
that I need to add the .exe extension. Apache adds the extension (before
the call to ap_call_exec), stats the file, then proceeds to run. 

If I request cgi-bin/test.exe, it almost always fails. I expect the
timing of the last stat in relation to the CreateProcess may have
something to do with this behaviour.

Observation 2:
If I initialize hStdError in STARTUPINFO to INVALID_HANDLE_VALUE, I
still see pid = 0, but the script runs and I don't see the problem.

Thoughts?


-- 
Bill Stoddard
stoddard@raleigh.ibm.com

Re: 16 bit CGIs on NT

Posted by Brian Behlendorf <br...@hyperreal.org>.
At 12:03 PM 1/29/99 -0500, Bill Stoddard wrote:
>16bit CGIs fail -intermittently-. In the failure case, the
>CreateProcess() call (in util_script.c) is successful, but all the
>fields in the PROCESS_INFORMATION structure (pid, thread handle, etc.)
>are NULL or 0. 
....
>If I request cgi-bin/test.exe, it almost always fails. I expect the
>timing of the last stat in relation to the CreateProcess may have
>something to do with this behaviour.
....
>Thoughts?

This is probably not the most helpful commentary, but I can't say I see the
need to support 16bit CGI's, particularly if the interface to them is so
broken...

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
History is made at night;                         brian@hyperreal.org
  character is what you are in the dark.