The information in this article applies to:
SYMPTOMSA "Stack overflow" or access violation error, or hanging of the server may occur due to an ISAPI DLL or custom Active Server Pages (ASP) component in Internet Information Server (IIS) 4.0. This problem does not occur when the same code and data are used in Internet Information Server 3.0. CAUSEThe maximum stack size of a thread has been reduced from 1 MB in IIS 3.0 to 256 KB in IIS 4.0. RESOLUTIONReduce the ISAPI DLL's or ASP component's use of the stack to fit within the reduced size of the IIS 4.0 stack. See the MORE INFORMATION section below for hints. STATUSThe change in stack size is by design. MORE INFORMATION
The maximum size of a thread's stack is determined by the executable file
of the process, not by the individual ISAPI DLL or ASP component that is
running inside the process. Both the IIS 4.0 version of Inetinfo.exe (for
in-process Web applications) and Mtx.exe (which hosts out-of-process Web
applications) are set to a 256 KB maximum stack size. This follows the
changed standard for all Windows NT system executables.
This function could not be successfully called in IIS 4.0, but probably
would have worked in IIS 3.0. To avoid using the stack, allocate the memory
dynamically:
Dynamically allocated memory is not stored on the stack, so the function no
longer needs 400,000 bytes of stack space, and should work on IIS 4.0
Another way that stack space can be quickly exhausted is with recursive function calls. If a function requires 40 bytes for local variables and arguments, and calls itself recursively 10,000 times, then 400,000 bytes of stack space would be needed. Again, this would likely work on IIS 3.0, but not on IIS 4.0. A CGI program would not be affected by the change in stack size. A new process is created when the CGI program is launched, and the stack size is determined from the CGI executable, not from Inetinfo.exe. Additional query words:
Keywords : kbnokeyword |
Last Reviewed: August 26, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |