|
From: Madhan S. <mad...@gm...> - 2008-10-13 12:29:34
|
Hello,
Here's a snippet of valgrind's report.
==1800== Invalid read of size 8
==1800== at 0x5F96FF8: (within /scratch/lib/libapp.so)
==1800== by 0x5BF5744: mapfunc (mapf.c:1321)
==1800== by 0x5BE5894: assembledata (assemd.c:2049)
==1800== by 0x804D391: main (amd.c:444)
==1863== Address 0x64FA7A8 is 0 bytes after a block of size 10,280 alloc'd
==1800== at 0x40046F2: malloc (vg_replace_malloc.c:149)
... ....
The statement at mapf.c:1321 is
memcpy(dst, src, sizeof(shared_buf));
Adding following printf and --trace-malloc=yes
VALGRIND_PRINTF("dst %p src %p size %d\n", dst, src,
sizeof(shared_buf));
The following is seen before the invalid read,
--1863-- malloc(10280)
--1863-- = 0x64F7F80
**1863** dst 0x6505190 src 0x64FA5F8 size 432
The src passed has 432 valid bytes and is not freed before the read.
The code was compiled with intel compiler version "icc (ICC) 9.1 20070512"
using "-debug minimal", flag. The issue does not appear when "-g" debug
flag is used.
I have seen a few cases of false positives when optimized libraries are
used, but this is the first time a false positive has appeared with
-debug minimal.
Is this expected.
Thanks,
Madhan.
|