Stack Overflow Problem
-
I am developing a media player,but due to a stack overflow during runtime my whole application crashes...how to tackle this problem. Please help me???:confused: harish software engineer
Use the heap instead of the stack. Did you have a fonction using a array define on the stack like: void myfunction(tatata) { DWORD data[1024]; // 1024*4 bytes allocated on the stack DWORD *pdata = new DWORD[1024]; // 1024*4 bytes allocated on the heap .... } Does that help?
-
I am developing a media player,but due to a stack overflow during runtime my whole application crashes...how to tackle this problem. Please help me???:confused: harish software engineer
Use the debugger. Run your program inside the debugger and before it gets to the stack overflow, open the Debug/Exceptions box and look for the "Stack Overflow" exception. Click on the "Stop always" radio button and then OK. Continue running. When the stack overflow occurs, the program will stop at the point where it's happening. That should give you a clue as to why it's happening and you can then fix it. Good luck, Alvaro