[Mesa-dev] [PATCH] util: add more memory debugging features

Kenneth Graunke kenneth at whitecape.org
Wed Nov 28 12:56:42 PST 2012


On 11/28/2012 12:39 PM, Brian Paul wrote:
> Add a DEBUG_FREED_MEMORY option to help catch use-after-free errors.
> Add debug_memory_check() function which can be periodically called to
> check that all known blocks are good.
> ---
>   src/gallium/auxiliary/os/os_memory_debug.h  |    3 +
>   src/gallium/auxiliary/util/u_debug_memory.c |   82 ++++++++++++++++++++++++++-
>   2 files changed, 84 insertions(+), 1 deletions(-)

Perhaps a stupid question, but isn't this exactly what valgrind is 
designed for?  (It works exceeding well at...you can even use 
--db-attach=yes to set a breakpoint at the exact location where you 
read/write the invalid memory...)


More information about the mesa-dev mailing list