|
From: Nicholas N. <nj...@cs...> - 2007-12-20 01:47:56
|
On Wed, 19 Dec 2007, Sahni, Jitan wrote: > is there any way in memcheck to detect out of bound array access, when > using stl objects like std::string and std::map ? Recently I had once such > bug and took me about 10 days with valgrind before it pin pointed me to > exact error line and I think reason for this may be because stl may be > doing a bit of its own memory management . e.g when a string of say size 5 > bytes is created and then destroyed, stl may request say 64 bytes from the > heap and try to recycle that. I was thinking if there is an option to > directly check stl array bounds so that the error can be caught sooner Memcheck will only detect such errors if the array edge happens to be at a heap block edge. It's an inherent limitation in Memcheck, one that's extremely difficult to avoid. Nick |