|
From: Julian S. <js...@ac...> - 2015-04-01 22:41:51
|
On 01/04/15 21:25, Philippe Waroquiers wrote: > On Tue, 2015-03-31 at 15:28 -0300, Andres Tiraboschi wrote: >> But if you want to replace functions from pthread like helgrind and >> drd do you have to replace the client malloc/free >> I don't know why. > To my knowledge, there is no need to replace malloc/free to have > helgrind or drd working. Well, I think it is important, because both tools need to know when memory is freed and later re-allocated. Without that, they would report false races on memory that has been freed and then reallocated to a different thread. In effect the freeing marks the memory as un-tracked and causes them to "forget" what they know about it. Also, it helps generate better error messages. With malloc/free intercepting, we can generate address descriptions like "address X is N bytes inside a block of size M allocated at ..". J |