IIS Stack Overflow

We chased a bug in my WCF web application (W2K3 IIS) which led to a stackoverflow transition.

To fix this, I needed to increase the stack of my application by creating a stream with the amount of memory that I wanted to allocate.

But what happens to child threads? My application creates many threads, do they inherit the value or will I need to install each individual thread with a new value?

Edit: if I run services (WCF) as a console host, they work fine. Also, if I modify the w3wp.exe stack (using EDITBIN), they also work fine in IIS.
Therefore, I need to increase the stack. I know that I can create a stream with a stack size (is there any other way?), But I need to know what happens to the child streams.

Edit2: We need to define some BIG vectors that lead to stack overflows. So this is not a mistake in our system. I really need to (have) increase the stack

+2
source share
2 answers

Having tried it, I can say yes! In child threads, the stack count is set to the parent thread.

+2
source

It sounds like you need to think more carefully about why you are getting stack overflows rather than just allocating more memory.

Is there any function with a huge number of local variables or an array that goes on the stack?

Are you sure you are not leaking somewhere with unintended recursive loops?

-Adam

+1
source

All Articles