« Getting together in B… | Home | Greetings from Birmin… »

Tip of the night: Thread Stacksize

The stack size of threads is an issue. It can cause random crashes. For code in Real Studio, there is extra code inserted in every method to ensure you get a StackOverflowException. But in C code, this check is not performed. So if you have a full stack and you call into the Real Studio runtime, some DLL or a plugin, the function can overwrite the some objects in memory located behind the end of the stack.
With a tiny stack of just 64 K by default on Mac this is very likely to happen with a little bit of recursion.
So please set stacksize to a higher value like one million bytes.
Also sign on this bug report: 22996: Increase default Thread.Stacksize
02 11 12 - 00:35