|
From: Jonathon <the...@gm...> - 2009-08-11 16:51:29
|
Thanks Tom for the help. The --db-attach command is very cool :) So with the invalid read, it is trying to read an address that is not valid. Would you happen to know what the line "16 bytes inside a block 24 free'd" means? I am using an std::list. Is it possible the problem is in the list? and not my actual code? Thanks. On Tue, Aug 11, 2009 at 9:13 AM, tom fogal<tf...@al...> wrote: > Jonathon <the...@gm...> writes: >> I was wondering if it is possible to get valgrind to make an "assert" >> so my debugger can catch it when a memory error occurs? I would like >> to determine what is causing this memory error and it would be nice >> if I could do this. > > No, but it can do better: suspend the process and automatically start > your debugger. Use the --db-attach=yes option. > >> Also, I am having a hard time deciphering this message, can anyone >> please give me insight on what this error means? I've tried Google and >> I had no luck :( > [snip] >> 1. ==20770== Invalid read of size 8 >> 2. ==20770== at 0x662CBB: PacketPool::removePacket(Packet*) > > It means a variable, of width 8 (e.g. a double, long on amd64, etc.) > is being read from yet is not valid. `Read' probably means it's an > rvalue. `Invalid' implies the address is bad. IIUC, memory is invalid > by default, marked valid when you assign to it, marked invalid when you > delete/free it. There's a bit in the memcheck manual about 'shadow > bits' and how they are used to track validity, IIRC. > > -tom > |