On 31/03/11 20:32, Bob Harris wrote:

> I agree with you;  I'm absolutely certain that the size of the
> allocation block is what triggers the message.  In my case such a
> large allocation is not an error unless the system libraries can't
> handled it.  As I've mentioned in both my previous posts, I am trying
> to determine whether the problem is (a) not really a problem (i.e.
> problem occurs only when using valgrind), (b) is a problem with the
> runtime library (the runtime library is leaking a block during
> realloc), (c) is a problem with valgrind not being able to deal with
> large allocations, or (d) a problem in my program.
>
> (d) seems unlikely because the simple test program exhibits a similar
> failure.  If the problem is (c) I'd like to VERIFY that so I can quit
> searching, or if there's a way to build valgrind that will allow it to
> handle programs that allocate large memory blocks, I'd like to know
> how to do it.  If it can't it can't, but I'd like to know I've
> exhausted all avenues before giving up on this.

I've looked back at your original post and the main problem with it is 
that you didn't really provide any information (like the text of the 
error reports from valgrind) that might let us help you.

Instead you seemed to have jumped to a conclusion that valgrind is 
somehow broken and start speculating that maybe it can't handle large 
chunks of memory.

The simple answer is that, assuming you don't actually run of of memory 
or address space, valgrind really couldn't care less how small or large 
the chunks of memory you use are. If you were to run of space then you 
would get an error.

Valgrind has told you that you are reading more data into a buffer than 
you have allocated space for - it is almost certainly correct. Trust it 
and investigate the problem it is telling you about.

Ignore the segfault for now - that is just a consequence of you 
overrunning the buffer. It not happening outside of valgrind is of no 
consequence, it just means you are getting lucky. Under valgrind the 
memory layout will be different and you are happening to overwrite 
something that then causes the crash.

And yes, as John has told you, you can ignore those warnings about large 
address ranges.

Tom

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

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to