On 03/01/2013 06:23 AM, David Chapman wrote: > On 2/28/2013 4:58 PM, John Reiser wrote: >>> Hi all, I'm wondering if it's possible for memcheck to show the last place >>> that > some memory was accessible before being leaked.
This has been discussed before, and there was an experimental tool (Omega) to do that. It would be feasible to build a tool to refcount pointers to blocks, but the fundamental problem is that the last pointer to a block might get overwritten at some place which is totally nonsensical from the programmer's point of view. In particular, imagine that the last pointer to a block ends up in a spill slot on the stack, and at some later point the compiler generated code to use the spill slot to hold some new value. Then, the last pointer would disappear at the point of that overwrite. IOW .. the idea of tracking the last pointer to a block depends on the assumption that the only loads/stores in the generated machine code are directly related to source language constructs. But that's not the case, because of spilling during register allocation. AFAIK, there's no way to do this reliably at the machine code level. J ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users