On 24/09/12 19:15, Chris Fallin wrote:

> Question: will "Invalid read of size N" occur if the dataflow tracking
> thinks that the address itself is invalid, or does it only occur if
> the address being accessed is not fully enclosed by an alloc'd/stack'd
> block or global data? (If the latter, why would the message appear if
> base address + access size <= end of block, as is seen here?) I gather
> that it's separate from an "undefined value" message which would occur
> if the value *at* the address had not been initialized...

It sounds like you're a bit confused about valgrind works...

There is no dataflow tracking, just tracking of which bytes of memory 
are addressable and which bits are defined.

So when a block is allocated with malloc it will be marked as 
addressable but not defined and it wouldn't normally be marked 
unaddressable until it was freed.

I think the only real exception to that, other that for the stack as 
described before, is where a client request is used to explicitly mark a 
piece of memory as unaddressable.

Reading a word which overlapped the end of a block would certainly 
produce that error, but that isn't what is happening here as you say.

Tom

-- 
Tom Hughes ([email protected])
http://compton.nu/

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to