Page 1 of 1
Debugging problem
Posted: Wed Jul 09, 2008 2:27 pm
by goosey
I've been working on a project that uses SDL (
http://www.libsdl.org), and I've encountered the following problem:
The debugger stopped working all of a sudden. To be more specific, it claims that the program that I'm trying to debug caused a segmentation fault, even though the program doesn't contain any errors that could cause a segmentation fault.
So basically, I just compile the program and press F5, and a message window pops up that says "Program received Signal SIGSEGV..." etc.
I probably just changed some setting without realizing it, but I can't figure out what it was.
I'm using CodeLite 1.0 on Windows XP (sp 2).
EDIT: I should have mentioned that the problem occurs only when trying to debug SDL programs. Programs that use the standard C++ libraries work fine.
Re: Debugging problem
Posted: Wed Jul 09, 2008 11:16 pm
by eranif
My guess is that your code does cause a crash...
When this dialog pops up, click 'No' and view the 'Stack' tab in the 'Debugger' view this should give u a hint of what went wrong.
Eran
Re: Debugging problem
Posted: Thu Jul 10, 2008 12:04 pm
by goosey
Sorry, I should have been more clear. I tried to say that the program runs normally when I press ctrl+F5, but when I try to debug it, CodeLite claims that the program caused a segmentation fault, which seems a little weird, because I just ran the program without debugging it, and it didn't crash. For example the following sample SDL program, which definitely does not contain any errors, works just fine when I run it with ctrl+F5, but
when I try to debug it, CodeLite claims that it caused a segmentation fault.
Code: Select all
#include "SDL/SDL.h"
int main( int argc, char* args[] )
{
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Quit SDL
SDL_Quit();
return 0;
}
eranif wrote:When this dialog pops up, click 'No' and view the 'Stack' tab in the 'Debugger' view this should give u a hint of what went wrong.
Yeah, I tried that. Here are the contents of the Stack tab.
Code: Select all
Level Address F Line
0 0x100089a1 ??
1 0x00000000 ??
I don't know what to make of that.
These SDL programs used to work perfectly with CodeLite, I could debug them without any problems, etc..
So I'm guessing that I accidentally changed some setting...I can't think of any other explanation..
Re: Debugging problem
Posted: Thu Jul 10, 2008 12:52 pm
by eranif
What happen if you try to debug it from the command line?
Does it work under gdb or ... ?
Re: Debugging problem
Posted: Thu Jul 10, 2008 1:26 pm
by goosey
Code: Select all
Program received signal SIGSEGV, Segmentation fault.
0x100089a1 in ?? () from C:\WINDOWS\system32\guard32.dll
guard32.dll is a part of Comodo Firewall Pro.. After I turned off
the firewall and renamed guard32.dll, the problem disappeared. Time to get a new firewall, I guess...
Re: Debugging problem
Posted: Thu Jul 10, 2008 10:46 pm
by varnie
goosey wrote:Sorry, I should have been more clear. I tried to say that the program runs normally when I press ctrl+F5, but when I try to debug it, CodeLite claims that the program caused a segmentation fault, which seems a little weird, because I just ran the program without debugging it, and it didn't crash. For example the following sample SDL program, which definitely does not contain any errors, works just fine when I run it with ctrl+F5, but
when I try to debug it, CodeLite claims that it caused a segmentation fault.
hey, eranif. i am experiencing the same problem with tracing/debugging problem in CodeLite IDE (revision 1791), but running on FreeBSD box. i have C++ project which uses several headers from boost library (
http://www.boost.org) and "sometimes" when i try to trace my program flow in CodeLite IDE step by step it claims that my program caused a segmentation fault (and gdb crashes producing gdb.core file). i can swear my code is 100% correct, it compiles and runs without problem.
i noticed that after i shut down CodeLite IDE and re-run it again my projects traces/debugs fine.
Re: Debugging problem
Posted: Thu Jul 10, 2008 11:00 pm
by eranif
varnie wrote:(and gdb crashes producing gdb.core file)
Well, I think this is gdb fault...
However, do you have any entries in the watch table?
I have noticed, that when keeping a non existing entry in the watch table, while leaving scope, CodeLite still tries to query gdb about that parameter, but if it does no longer exist (i.e. the program flow left the scope) under certain circumstances, gdb will crash.
Clearing the watch table will solve your problem.
More, your problem
is not related to goosey's problem, since goosey's code crash even when not running under CodeLite (he ran gdb from command line).
Eran
Re: Debugging problem
Posted: Thu Jul 10, 2008 11:23 pm
by varnie
eranif wrote:
However, do you have any entries in the watch table?
not always.
More, your problem is not related to goosey's problem, since goosey's code crash even when not running under CodeLite (he ran gdb from command line).
yes, that's so. when i'm debugging my code right in console gdb, it's OK.