Since last 3 to 4 days, I hadn't done even a single defect fix. Time was getting consumed in reviews, meetings and investigations. In the last 3 days, I was getting tired too much. Finally, found the reason for that - I was not hearing to Music last 3 days. Ok, this blog is to explain some tool that I learnt today in detecting memory issues like leaks, corruptions, heap usage etc....
It is MemoryScape. Its a good tool. This can be attached to the running process, or the core that got generated or the new program that to be started.
First, faced problems in attaching this to my binary file - as my binary file not generated using the libraries provided by this tool. Finally was able to do by using LD_PRELOAD environment variable.
But, leaks reporting is not happening. That tool provides some so's. At the time of linking, it makes any fork or malloc or free calls to its functions and then it tracks them. And, then, internally, they call the original functions.
Attached para is copied from its document:
Behind the Scenes
MemoryScape intercepts calls made by your program to heap library functions that allocate and deallocate memory by using the malloc() and free() functions and related functions such as calloc() and realloc(). The technique it uses is called interposition. Our interposition technology uses an agent routine to intercept calls to functions in this library.
In the similar way, fork also gets intercepted. Just compiled my code with them and yet to test them. In the mean while compilation is going, thought of putting this here....