|
From: Greg C. <chi...@mi...> - 2004-09-27 11:41:24
|
Shanti Rao wrote: > > When I run a console program from the console, I get a message saying > > This application has requested the Runtime to terminate it in an unusual > way. > Please contact the application's support team for more information. > > But it works fine when I run the program from gdb. Methinks the console > interface isn't being set up right. This set of symptoms arises frequently. Typically, the problem is an uninitialized variable. Such a variable has a random value when you run it normally, but the debugger may happen to zero-initialize it, making the program seem to work. Try to reduce the program to a tiny testcase that reliably reproduces the problem. Once you've eliminated everything that's not the problem, you'll probably see it. Alternatively, try using a 'malloc debugger' such as mpatrol. Or add lots of runtime assertions to check sanity at every step. Or try using a map file to find where the problem is, and backtrack from there. |