I'm looking for a powerful memory debugger for Linux ( open source or commercial ). The prereqs are fairly simple ...
- must be able to cope with C and C++
- must be able to detects leaks
- must be able to detect memory errors ( example below )
- must be fast enough to debug appliactions with user interface ( basically must be responsive enough to click through the menus/buttons/etc )
the following are the key memory errors that are pretty much a must as far as detection goes. Naming convension is up for grabs, all I care about is a report with a line number and some indication of error type
so far I've tried ..
- mpatrol, which is fantastic when it comes to the detection features, but horribly slow with Motif/Xt
- Great Circle, which has a nice web based interface and is quite speedy, but failed to find any errors except for the leaks (??)
** some commonly used OS debuggers like dmalloc/mprof are out of the question since they can't debug C++ code.
Anyway, if anyone has any suggestions, please free to post them here
- must be able to cope with C and C++
- must be able to detects leaks
- must be able to detect memory errors ( example below )
- must be fast enough to debug appliactions with user interface ( basically must be responsive enough to click through the menus/buttons/etc )
the following are the key memory errors that are pretty much a must as far as detection goes. Naming convension is up for grabs, all I care about is a report with a line number and some indication of error type
Code:
int main( )
{
/* leak with free */
char* fc = (char*)malloc(32);
/* leak with new */
char* nc = new char[64];
/* free mismatched memory */
char* nm = new char[64];
delete nm;
/* try again, this time with free */
nm = new char[64];
free(nm);
/* leak some more */
int* i = new int[16];
int* j = new int;
int* k = new int[16];
delete j;
/* free memory write */
*j = 5;
/* array bounds write */
i[16] = 10;
/* array bounds read */
k[0] = i[16];
}
so far I've tried ..
- mpatrol, which is fantastic when it comes to the detection features, but horribly slow with Motif/Xt
- Great Circle, which has a nice web based interface and is quite speedy, but failed to find any errors except for the leaks (??)
** some commonly used OS debuggers like dmalloc/mprof are out of the question since they can't debug C++ code.
Anyway, if anyone has any suggestions, please free to post them here