3

I have a process that is overflowing the stack when run from within an IIS process, but works fine when run on its own. I suspect that on its own it gets the default 1MB stack, but within IIS gets somewhat less.

To avoid messing with the IIS worker processes I am using a sub-thread within the IIS process to allocate a bigger stack, but I suspect the stack size argument to Thread creation is being ignored as per the documentation (http://msdn.microsoft.com/en-us/library/ms149581.aspx)

When the stack overflows I can view the halted process in the debugger, but how do I find out how big a stack was actually allocated?

Matt T
  • 607
  • 3
  • 10

1 Answers1

2

The answer is as follows.

In debugger, add a watch on the pseudo register TIB (http://msdn.microsoft.com/en-us/library/aa232399(v=vs.60).aspx )

Now take this value and display that address in a memory window. Subtract the third 4 byte word from the second 4 byte word, remembering to use little endian byte ordering. http://en.wikipedia.org/wiki/Win32_Thread_Information_Block

Matt T
  • 607
  • 3
  • 10