From: Nicholas N. <nj...@ca...> - 2004-07-29 08:32:48
|
On Wed, 28 Jul 2004, Samofatov, Nickolay wrote: > In this case I marked mmap'd block with VALGRIND_MALLOCLIKE_BLOCK. If I > do not mark the block message persists, but says block is not stack'd, > alloc'd or free'd. > > I have a couple questions. > 1) Is writing suppressions right way to deal with the problem I'm > having? Or I should be marking my extents somehow? > 2) Is my approach of interfacing with Valgrind generally correct? Off the top of my head, your basic approach seems to be right, but I haven't checked the details thoroughly. Have you got the redzones right? If you have, for example, a 100-byte payload and 4-byte redzones, you'll need a 108 byte block (plus any extra admin words used by your allocator, but you don't need to tell Valgrind about that. You shouldn't be using suppressions here, if everything was done right it should just work. If I were you, I would pull the memory allocator out into the smallest possible program, and experiment with that. I find that a good technique in general when experimenting with an unfamiliar language feature or something like this, because it's much easier to work out what's going on when it's not buried inside something larger. HTH N |