On Fri, May 17, 2013 at 4:48 PM, Irek Szczesniak <[email protected]> wrote:
> On Fri, May 17, 2013 at 2:52 AM, Roland Mainz <[email protected]> 
> wrote:
>> Attached (as "valgrind381_libast_allocator001.diff.txt") is a patch
>> for valgrind 3.8.1 which enables valgrind (again) to recognise the
>> libast memory allocator (long ago it worked out-of-the-box but somehow
>> it got broken).
>>
>> The basic idea of the fix is to teach valgrind that the matching
>> memory allocation/deallocation functions are prefixed with |_ast_*()|.
>
> Just curious - how long did it take to figure that valgrind is broken

I know that since a month for so because some things which didn't work
should've triggered valgrind...

> for AST and to make the fix?

The prototype fix mainly needed a lot of digging+research (and
gnaw'ing off my fingernails to figure out how valgrind works... maybe
eight manhours or something like that...
... the research digged out some issues with valgrind which have to be
addressed from their side in the future:
1. valgrind needs support for multiple, independent memory allocators
operating in the same process. Right now it operates in "one allocator
to rule them all"-mode and doesn't properly detect issues when memory
obtained via |_chicken_malloc()| is passed to |_fish_free()| (instead
of |_chicken_free()|)). This is *lots* of work and may require some
restructuring how "valgrind"'s "memcheck" tool works (that's around
2-3 manmonths of work... without support for "nested" memory pools).
2. We need the ability to configure "valgrind" to recognise
alternative names for |malloc()|, |realloc()|, |free()|,
|posix_memalign()| via command line options or an options file
(interestingly Google concurrently hit the same issue with similar
solutions - see http://code.google.com/p/valgrind-variant/).

I'm going to discuss that with the "valgrind" people when I have time...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to