I have a huge C++ codebase. On a certain set of data there's a stack overflow. If I run the program under Visual Studio debugger I get a call stack 30 unfamiliar functions deep - one (or more) of those functions created a too big object on stack and this lead to stack exhaustion. I looked at all functions and there's nothing obvious - nothing like
char buffer[512 * 1024];
I though I could add a variable at the beginning of each of those functions and dump that variable address and recompile and then look at difference between adjacent functions, but that's lots of manual labor.
How do I quickly identify the function that created a too large set of objects on stack and causes a buffer overflow?
strlenthen you'd probably want to look for something else rather than concluding, "oh dear,strlenuses too much stack" ;-)espin a debug window and then roam around the call stack, looking to see where it changes a lot?