|
From: tom f. <tf...@al...> - 2009-08-11 16:11:42
|
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 |