Methods to trace BPOINT messages. | developer.brewmp.com Methods to trace BPOINT messages. | developer.brewmp.com

Developer

Methods to trace BPOINT messages.

Forums:

Hi, what are the methods to trace BPOINT error messages such as the TYPE 3 message? I'm having trouble tracing BPOINT in a large base codes.

Thanks.

Tell me, sasayins, what you mean by "tracing" BPOINT messages?
"BPOINT 3" - this a notice about memory corruption. That is, that the program has made somewhere write into memory outside of array or structure bounds, or made attempt to modify already FREEd memory. On such errors, I only explored app behaviour through step by step tracing :(.
"BPOINT 1" - this is a notice of memory loss. That is situation where the memory allocated via the operator new / MALLOC (..). But it is not released until the completion of the app via delete / FREE (...). To facilitate the tracking of such errors, you can use a DBGHEAPMARK macro. For example:
ptr = MALLOC (somesize); DBGHEAPMARK (ptr, __FILE__, __LINE__);
or both:
object = new ObjectType (); DBGHEAPMARK (object, __FILE__, __LINE__);
__FILE__,__LINE__ - predefined macros from C/C++ compiler, which contains currently compiled file name and line number.

Tell me, sasayins, what you mean by "tracing" BPOINT messages?
"BPOINT 3" - this a notice about memory corruption. That is, that the program has made somewhere write into memory outside of array or structure bounds, or made attempt to modify already FREEd memory. On such errors, I only explored app behaviour through step by step tracing :(.
"BPOINT 1" - this is a notice of memory loss. That is situation where the memory allocated via the operator new / MALLOC (..). But it is not released until the completion of the app via delete / FREE (...). To facilitate the tracking of such errors, you can use a DBGHEAPMARK macro. For example:
ptr = MALLOC (somesize); DBGHEAPMARK (ptr, __FILE__, __LINE__);
or both:
object = new ObjectType (); DBGHEAPMARK (object, __FILE__, __LINE__);
__FILE__,__LINE__ - predefined macros from C/C++ compiler, which contains currently compiled file name and line number.

Thanks for the wonderful tips. What I meant about tracing BPOINT messages such as the type 3 message is how can I use the information such as the address in BPOINT in debugging process, or putting "watch" address in VS 2005?

Thanks for the wonderful tips. What I meant about tracing BPOINT messages such as the type 3 message is how can I use the information such as the address in BPOINT in debugging process, or putting "watch" address in VS 2005?

sasayins wrote:Thanks for the wonderful tips. What I meant about tracing BPOINT messages such as the type 3 message is how can I use the information such as the address in BPOINT in debugging process, or putting "watch" address in VS 2005?
"BPOINT 3" message usually appears when you trying to release the damaged heap area. Example:
char * memblock_for_string = (char *) MALLOC (32);
...
memblock_for_string [33] = '\ 0'; / * memory corruption, as it is * /
...
FREE (memblock_for_string); / * BPOINT 3! * /
So, first you must look at which call of delete/FREE (ptr) "BPOINT 3" appears.
Then see where the heap allocated for 'ptr', and where 'ptr' is used. Set breakpoints in all suspicious places, then restart the application and check the state of the memory addressed by 'ptr', at each breakpoint.
Don't forget to set breakpoints at the class destructors.
Unfortunately, I have no experience with professional software for the detection heap corruption errors, such as BoundsChecker: (

sasayins wrote:Thanks for the wonderful tips. What I meant about tracing BPOINT messages such as the type 3 message is how can I use the information such as the address in BPOINT in debugging process, or putting "watch" address in VS 2005?
"BPOINT 3" message usually appears when you trying to release the damaged heap area. Example:
char * memblock_for_string = (char *) MALLOC (32);
...
memblock_for_string [33] = '\ 0'; / * memory corruption, as it is * /
...
FREE (memblock_for_string); / * BPOINT 3! * /
So, first you must look at which call of delete/FREE (ptr) "BPOINT 3" appears.
Then see where the heap allocated for 'ptr', and where 'ptr' is used. Set breakpoints in all suspicious places, then restart the application and check the state of the memory addressed by 'ptr', at each breakpoint.
Don't forget to set breakpoints at the class destructors.
Unfortunately, I have no experience with professional software for the detection heap corruption errors, such as BoundsChecker: (

wow, thanks for the info especially about the memory corruption thing. Ok I'll try to post here the results if I found out what causes my BPOINT type 3. And is it possible to use memory profiler to check any memory corruption?

wow, thanks for the info especially about the memory corruption thing. Ok I'll try to post here the results if I found out what causes my BPOINT type 3. And is it possible to use memory profiler to check any memory corruption?

sasayins wrote:wow, thanks for the info especially about the memory corruption thing. Ok I'll try to post here the results if I found out what causes my BPOINT type 3. And is it possible to use memory profiler to check any memory corruption?
sasayins, did you mean "memory debugger"? I am now trying to learn how to works with similar software - Insure + + from Parasoft.
If you want cooperation - please, write me at eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%64%6d%69%74%72%79%40%73%65%78%6d%61%67%6e%65%74%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%64%6d%69%74%72%79%40%73%65%78%6d%61%67%6e%65%74%2e%63%6f%6d%3c%2f%61%3e%27%29%3b')), I am pleased to help you. I like challenges :)

sasayins wrote:wow, thanks for the info especially about the memory corruption thing. Ok I'll try to post here the results if I found out what causes my BPOINT type 3. And is it possible to use memory profiler to check any memory corruption?
sasayins, did you mean "memory debugger"? I am now trying to learn how to works with similar software - Insure + + from Parasoft.
If you want cooperation - please, write me at eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%64%6d%69%74%72%79%40%73%65%78%6d%61%67%6e%65%74%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%64%6d%69%74%72%79%40%73%65%78%6d%61%67%6e%65%74%2e%63%6f%6d%3c%2f%61%3e%27%29%3b')), I am pleased to help you. I like challenges :)

Dmitry V. Zhada wrote:sasayins, did you mean "memory debugger"? I am now trying to learn how to works with similar software - Insure + + from Parasoft.
If you want cooperation - please, write me at eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%64%6d%69%74%72%79%40%73%65%78%6d%61%67%6e%65%74%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%64%6d%69%74%72%79%40%73%65%78%6d%61%67%6e%65%74%2e%63%6f%6d%3c%2f%61%3e%27%29%3b')), I am pleased to help you. I like challenges :)
not memory dubugger, what I mean is a software to check any possible memory corruption from the source. Yeah me too I'm learning memory debugger especially brew debugger. And I heard about the insure++, unfortunately its a commercial one.

Dmitry V. Zhada wrote:sasayins, did you mean "memory debugger"? I am now trying to learn how to works with similar software - Insure + + from Parasoft.
If you want cooperation - please, write me at eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%64%6d%69%74%72%79%40%73%65%78%6d%61%67%6e%65%74%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%64%6d%69%74%72%79%40%73%65%78%6d%61%67%6e%65%74%2e%63%6f%6d%3c%2f%61%3e%27%29%3b')), I am pleased to help you. I like challenges :)
not memory dubugger, what I mean is a software to check any possible memory corruption from the source. Yeah me too I'm learning memory debugger especially brew debugger. And I heard about the insure++, unfortunately its a commercial one.