BoundsChecker is only reporting one error when it's happening multiple times.

0 Likes

Problem:

I'm running the following code with vc (and BC integrated debugging):

char* leak(void)

{

return new char[100];

}

char* leak1(void)

{

return leak();

}

char* leak2(void)

{

return leak();

}

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR

lpCmdLine, int nCmdShow)

{

leak1();

leak2();

return 0;

}

when the program finishes I get only one leak report, furthermore I can't see the stack (i.e. to expand the reported leak as I have used to see with BCPro4.0).

Do I need special configuration to get this behavior ? why do I get only one leak reported when there are 2 leaks ?

Resolution:

You are getting only one leak because of a BoundsChecker option in the BoundsChecker settings | Error Detection | Detailed error reporting | "Report each error only once". Turn this off if you want to see every occurance of the leak.

As for the call stack, you should be seeing the call stack to the right of the treeview when you select your leak if you are running in maximum mode. The expand/collapse you are describing sounds like the mixed events/error option. Be sure you have event reporting turned on in the BoundsChecker settings. When the run is complete go to BoundsChecker | view | show all events. This should give you the errors and the events that lead to those errors.

Old KB# 12216
Comment List
Anonymous
Related Discussions
Recommended