|
From: Shanti R. <sha...@ea...> - 2004-09-27 08:17:37
|
Hi folks, 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. The -mwindows, -mconsole, -mole options seem to have no effect. My linker command is presently gcc.exe -s -o jsdb_gcc.exe -mconsole -mwindows -mole obj\gcc\*.o obj\gcc\jsdb.coff -lole32 -lws2_32 -lstdc++ -lodbc32 -loleaut32 -lmapi32 -lcomdlg32 -luuid Any suggestions? Thanks! Shanti |
|
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. |
|
From: Leo <ch...@te...> - 2004-09-27 19:11:35
|
heapcheck may be useful too (may need to modify it a bit to compile with mingw): http://www.softlab.ece.ntua.gr/~ttsiod/HeapCheck.html Also there's DrMingw (from mingw-utils), for JIT debugging , great for these situations. Also, make sure you use the latest stable mingw. Happy bug busting. :) Greg Chicares wrote: > 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. > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |
|
From: Shanti R. <sha...@ea...> - 2004-09-27 20:04:31
|
Thanks for the suggestions. The problem turned out to be that argv[0] wasn't I was expecting, and my attempt to fopen(argv[0]) failed. Shanti > heapcheck may be useful too (may need to modify it a bit to compile > with mingw): > http://www.softlab.ece.ntua.gr/~ttsiod/HeapCheck.html > > Also there's DrMingw (from mingw-utils), for JIT debugging , great for > these situations. > > Also, make sure you use the latest stable mingw. > > Happy bug busting. :) > > > Greg Chicares wrote: > >> 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. >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 >> Project Admins to receive an Apple iPod Mini FREE for your judgement on >> who ports your project to Linux PPC the best. Sponsored by IBM. >> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php >> _______________________________________________ >> MinGW-users mailing list >> Min...@li... >> >> You may change your MinGW Account Options or unsubscribe at: >> https://lists.sourceforge.net/lists/listinfo/mingw-users >> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |
|
From: Earnie B. <ea...@us...> - 2004-09-27 11:54:34
|
Shanti Rao wrote: > Hi folks, > > 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. > > The -mwindows, -mconsole, -mole options seem to have no effect. My > linker command is presently > > gcc.exe -s -o jsdb_gcc.exe -mconsole -mwindows -mole obj\gcc\*.o > obj\gcc\jsdb.coff -lole32 -lws2_32 -lstdc++ -lodbc32 -loleaut32 > -lmapi32 -lcomdlg32 -luuid > Any suggestions? This smells as if you've an invalid memory reference somewhere. Possibly an uninitialized pointer. Earnie -- http://www.mingw.org http://sourceforge.net/projects/mingw https://sourceforge.net/donate/index.php?user_id=15438 |