Thread: valgrind output

valgrind output

From
"surabhi.ahuja"
Date:
Hi
i have a test runner and i am using valgrind to analyse memory leak:
i use is as follows:
 
 valgrind --tool=memcheck --leak-check=yes --log-file=op ./dbExpressInstall -r "dbexpress" -s "/gsp-dist/blr/developer/surabi/images/mr/im152" 1 1 1
 
here is the output:
 
 ==6214== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 76 from 1)
==6214== malloc/free: in use at exit: 31493 bytes in 200 blocks.
==6214== malloc/free: 4690 allocs, 4490 frees, 1046511 bytes allocated.
==6214== For counts of detected errors, rerun with: -v
==6214== searching for pointers to 200 not-freed blocks.
==6214== checked 4246552 bytes.
==6214==
==6214== 192 bytes in 4 blocks are possibly lost in loss record 18 of 33
==6214==    at 0x1B904E35: operator new[](unsigned) (vg_replace_malloc.c:139)
==6214==    by 0x1B944E73: TerraVector<TerraConfigurationElement>::ensureCapacity(unsigned) (/gsp-dist/blr/release/TERRA/rel
_views/TERRAUTIL/TERRAUTIL_20050525/src/include/terrautil/TerraVector.h:319)
==6214==    by 0x1B9449B3: TerraVector<TerraConfigurationElement>::push_back(TerraConfigurationElement const&) (/gsp-dist/bl
r/release/TERRA/rel_views/TERRAUTIL/TERRAUTIL_20050525/src/include/terrautil/TerraVector.h:206)
==6214==    by 0x1B94433B: TerraConfigurationElement::addChild(TerraConfigurationElement&) (/gsp-dist/blr/release/TERRA/rel_
views/TERRAUTIL/TERRAUTIL_20050525/src/cxx/terrautil/TerraConfigurationElement.cxx:173)
==6214==
==6214==
==6214== 216 bytes in 18 blocks are possibly lost in loss record 20 of 33
==6214==    at 0x1B904E35: operator new[](unsigned) (vg_replace_malloc.c:139)
==6214==    by 0x1B944D7A: TerraVector<TerraConfigurationElement>::TerraVector(unsigned, unsigned) (/gsp-dist/blr/release/TE
RRA/rel_views/TERRAUTIL/TERRAUTIL_20050525/src/include/terrautil/TerraVector.h:155)
==6214==    by 0x1B944B15: TerraConfigurationElementImp::TerraConfigurationElementImp(TerraCString const&) (/gsp-dist/blr/re
lease/TERRA/rel_views/TERRAUTIL/TERRAUTIL_20050525/src/cxx/terrautil/TerraConfigurationElement.cxx:13)
==6214==    by 0x1B943A54: TerraConfigurationElement::TerraConfigurationElement(TerraCString const&) (/gsp-dist/blr/release/
TERRA/rel_views/TERRAUTIL/TERRAUTIL_20050525/src/cxx/terrautil/TerraConfigurationElement.cxx:39)
==6214==
==6214==
==6214== 672 bytes in 6 blocks are definitely lost in loss record 25 of 33
==6214==    at 0x1B904A80: malloc (vg_replace_malloc.c:131)
==6214==    by 0x1BD8CB2E: PQmakeEmptyPGresult (in /usr/lib/libpq.so.3.2)
==6214==    by 0x1BD9390F: pqParseInput3 (in /usr/lib/libpq.so.3.2)
==6214==    by 0x1BD8DBC6: parseInput (in /usr/lib/libpq.so.3.2)
==6214==
==6214==
==6214== 1024 bytes in 1 blocks are definitely lost in loss record 28 of 33
==6214==    at 0x1B904BF7: operator new(unsigned) (vg_replace_malloc.c:133)
==6214==    by 0x1BD7F287: ???
==6214==    by 0x1BD7C5D1: ???
==6214==    by 0x1BACCEC8: ???
==6214==
==6214== LEAK SUMMARY:
==6214==    definitely lost: 1696 bytes in 7 blocks.
==6214==    possibly lost:   408 bytes in 22 blocks.
==6214==    still reachable: 29189 bytes in 170 blocks.
==6214==         suppressed: 200 bytes in 1 blocks.
 
Please tell me how should i proceed further as it is showing 1696 bytes definitely lost

Re: valgrind output

From
Martijn van Oosterhout
Date:
On Wed, Dec 14, 2005 at 02:43:16PM +0530, surabhi.ahuja wrote:
> Hi
> i have a test runner and i am using valgrind to analyse memory leak:
> i use is as follows:
>
>  valgrind --tool=memcheck --leak-check=yes --log-file=op ./dbExpressInstall -r "dbexpress" -s
"/gsp-dist/blr/developer/surabi/images/mr/im152"1 1 1  

Well, given that that all appears to be C++ code and psql doesn't
include any C++ code, it would appear to be Terra's problem, not ours.
Finally, 1600 bytes is nothing to worry about.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

Re: valgrind output

From
Tom Lane
Date:
Martijn van Oosterhout <kleptog@svana.org> writes:
> On Wed, Dec 14, 2005 at 02:43:16PM +0530, surabhi.ahuja wrote:
>> i have a test runner and i am using valgrind to analyse memory leak:

> Well, given that that all appears to be C++ code and psql doesn't
> include any C++ code, it would appear to be Terra's problem, not ours.
> Finally, 1600 bytes is nothing to worry about.

The only thing there that seems to have any connection at all to
Postgres is the leaked "PQmakeEmptyPGresult" data, which probably
is due to a missing PQclear() somewhere in the application.

            regards, tom lane