Re: [Valgrind-users] Usage and output with memory pools

2016-06-01 Thread Philippe Waroquiers
On Wed, 2016-06-01 at 10:19 -0700, John Reiser wrote: > On 06/01/2016, Marshall Lochbaum wrote: > >>From my perspective I have attempted to use Valgrind as intended, and it > > fails to provide the single most important piece of information for > > diagnosing a use-after-free error. I'm having diff

Re: [Valgrind-users] Usage and output with memory pools

2016-06-01 Thread John Reiser
On 06/01/2016, Marshall Lochbaum wrote: > Do you know whether what I want to do is possible with Valgrind, or are > you just offering generic advice? Neither of the freelist options > (freelist-vol and freelist-big-blocks) seem related, and indeed, > changing them doesn't affect Valgrind's output o

Re: [Valgrind-users] Usage and output with memory pools

2016-06-01 Thread Marshall Lochbaum
Do you know whether what I want to do is possible with Valgrind, or are you just offering generic advice? Neither of the freelist options (freelist-vol and freelist-big-blocks) seem related, and indeed, changing them doesn't affect Valgrind's output on either your test program or J. I'm well aware

Re: [Valgrind-users] Usage and output with memory pools

2016-05-26 Thread John Reiser
=recently.c #include "valgrind/valgrind.h" #include #include int main() { int *const m0 = malloc (1<<16); VALGRIND_CREATE_MEMPOOL(m0, (1<<16), 0); // a new pool inside a malloc()ed block int *const m1 = (4368/sizeof(int)) + m0; // point into the interior of the pool

Re: [Valgrind-users] Usage and output with memory pools

2016-05-26 Thread Marshall Lochbaum
Correct me if I've misread the code. It appears that for an address to be in a recently re-allocated block, it must be contained in a freed block as well as in an allocated block. How do I get Valgrind to tell me about the freed block, like it does with malloc/free? Marshall On Thu, May 26, 2016

Re: [Valgrind-users] Usage and output with memory pools

2016-05-26 Thread John Reiser
> ... The error message only indicates that the address is in one > of the memory pools. Valgrind states that the block is "recently > re-allocated", a term which I don't understand and which doesn't seem to > appear in any of the documentation. > ==4888== Address 0x5c31230 is 4,368 bytes insid

[Valgrind-users] Usage and output with memory pools

2016-05-25 Thread Marshall Lochbaum
Hello, I have been working on the memory model for J (the programming language). J uses a fairly standard memory pool system for small allocations, with a number of pools which are allocated once needed and store small values. My additions are shown here: https://github.com/iocane/unbox/commit/62