[CoinUtils-tickets] [COIN-OR Common Utilities] #50: valgrind reports error and memory leaks

COIN-OR Common Utilities coin-trac at coin-or.org
Sun Jun 15 10:04:26 EDT 2008


#50: valgrind reports error and memory leaks
------------------------+---------------------------------------------------
Reporter:  stefan       |       Type:  defect
  Status:  new          |   Priority:  major 
 Version:  trunk (SVN)  |   Keywords:        
------------------------+---------------------------------------------------
 {{{
 ==1299== Memcheck, a memory error detector.
 ==1299== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
 ==1299== Using LibVEX rev 1732, a library for dynamic binary translation.
 ==1299== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
 ==1299== Using valgrind-3.2.3, a dynamic binary instrumentation framework.
 ==1299== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
 ==1299== For more details, rerun with: -v
 ==1299==
 Testing CoinFinite ...  finite value: ok; infinite value: ok.
 Testing CoinIsnan ...  finite value: ok; NaN value: ok.
 Testing CoinModel
 Testing CoinError
 Testing CoinShallowPackedVector
 Testing CoinPackedVector
 Testing CoinIndexedVector
 Testing CoinPackedMatrix
 Testing CoinDenseVector
 Testing CoinMpsIO
 Testing CoinMessageHandler
 ==1299== Conditional jump or move depends on uninitialised value(s)
 ==1299==    at 0x4A077D0: strcpy (mc_replace_strmem.c:272)
 ==1299==    by 0x444860: CoinMessageHandler::gutsOfCopy(CoinMessageHandler
 const&) (CoinMessageHandler.cpp:488)
 ==1299==    by 0x44492A: CoinMessageHandler::operator=(CoinMessageHandler
 const&) (CoinMessageHandler.cpp:506)
 ==1299==    by 0x40AAFC: (anonymous
 namespace)::advTestsWithMessages(CoinMessages const&, int&)
 (CoinMessageHandlerTest.cpp:202)
 ==1299==    by 0x40B493: CoinMessageHandlerUnitTest()
 (CoinMessageHandlerTest.cpp:252)
 ==1299==    by 0x42BA0B: main (unitTest.cpp:203)
 All tests completed successfully.
 ==1299==
 ==1299== ERROR SUMMARY: 10 errors from 1 contexts (suppressed: 5 from 1)
 ==1299== malloc/free: in use at exit: 824 bytes in 42 blocks.
 ==1299== malloc/free: 23,233 allocs, 23,191 frees, 6,363,320 bytes
 allocated.
 ==1299== For counts of detected errors, rerun with: -v
 ==1299== searching for pointers to 42 not-freed blocks.
 ==1299== checked 165,176 bytes.
 ==1299==
 ==1299==
 ==1299== 82 bytes in 2 blocks are definitely lost in loss record 1 of 4
 ==1299==    at 0x4A059F6: malloc (vg_replace_malloc.c:149)
 ==1299==    by 0x4607CE:
 _ZL5yylexRP6symrecPKcPiRPcRiPKdRK13CoinModelHashS7_dR7YYSTYPE
 (CoinModelUseful2.cpp:852)
 ==1299==    by 0x460C8C:
 _ZL7yyparseRP6symrecPKcRPcRiPKdRK13CoinModelHashS6_dS6_R7YYSTYPES6_
 (CoinModelUseful2.cpp:1080)
 ==1299==    by 0x461600: CoinModel::getDoubleFromString(CoinYacc&, char
 const*) (CoinModelUseful2.cpp:1470)
 ==1299==    by 0x44E476: CoinModel::computeAssociated(double*)
 (CoinModel.cpp:1780)
 ==1299==    by 0x44E626: CoinModel::createArrays(double*&, double*&,
 double*&, double*&, double*&, int*&, double*&) (CoinModel.cpp:1804)
 ==1299==    by 0x450269: CoinModel::writeMps(char const*, int, int, int,
 bool) (CoinModel.cpp:1885)
 ==1299==    by 0x40F2AC: CoinModelUnitTest(std::string const&, std::string
 const&, std::string const&) (CoinModelTest.cpp:608)
 ==1299==    by 0x42B980: main (unitTest.cpp:174)
 ==1299==
 ==1299==
 ==1299== 102 bytes in 20 blocks are indirectly lost in loss record 2 of 4
 ==1299==    at 0x4A059F6: malloc (vg_replace_malloc.c:149)
 ==1299==    by 0x4605EE: _ZL6putsymRP6symrecPKci
 (CoinModelUseful2.cpp:716)
 ==1299==    by 0x461322: _ZL10init_tableRP6symrec
 (CoinModelUseful2.cpp:793)
 ==1299==    by 0x461576: CoinModel::getDoubleFromString(CoinYacc&, char
 const*) (CoinModelUseful2.cpp:1453)
 ==1299==    by 0x44E476: CoinModel::computeAssociated(double*)
 (CoinModel.cpp:1780)
 ==1299==    by 0x44E626: CoinModel::createArrays(double*&, double*&,
 double*&, double*&, double*&, int*&, double*&) (CoinModel.cpp:1804)
 ==1299==    by 0x450269: CoinModel::writeMps(char const*, int, int, int,
 bool) (CoinModel.cpp:1885)
 ==1299==    by 0x40F2AC: CoinModelUnitTest(std::string const&, std::string
 const&, std::string const&) (CoinModelTest.cpp:608)
 ==1299==    by 0x42B980: main (unitTest.cpp:174)
 ==1299==
 ==1299==
 ==1299== 576 bytes in 18 blocks are indirectly lost in loss record 3 of 4
 ==1299==    at 0x4A059F6: malloc (vg_replace_malloc.c:149)
 ==1299==    by 0x4605D8: _ZL6putsymRP6symrecPKci
 (CoinModelUseful2.cpp:715)
 ==1299==    by 0x461322: _ZL10init_tableRP6symrec
 (CoinModelUseful2.cpp:793)
 ==1299==    by 0x461576: CoinModel::getDoubleFromString(CoinYacc&, char
 const*) (CoinModelUseful2.cpp:1453)
 ==1299==    by 0x44E476: CoinModel::computeAssociated(double*)
 (CoinModel.cpp:1780)
 ==1299==    by 0x44E626: CoinModel::createArrays(double*&, double*&,
 double*&, double*&, double*&, int*&, double*&) (CoinModel.cpp:1804)
 ==1299==    by 0x450269: CoinModel::writeMps(char const*, int, int, int,
 bool) (CoinModel.cpp:1885)
 ==1299==    by 0x40F2AC: CoinModelUnitTest(std::string const&, std::string
 const&, std::string const&) (CoinModelTest.cpp:608)
 ==1299==    by 0x42B980: main (unitTest.cpp:174)
 ==1299==
 ==1299==
 ==1299== 742 (64 direct, 678 indirect) bytes in 2 blocks are definitely
 lost in loss record 4 of 4
 ==1299==    at 0x4A059F6: malloc (vg_replace_malloc.c:149)
 ==1299==    by 0x4605D8: _ZL6putsymRP6symrecPKci
 (CoinModelUseful2.cpp:715)
 ==1299==    by 0x460906:
 _ZL5yylexRP6symrecPKcPiRPcRiPKdRK13CoinModelHashS7_dR7YYSTYPE
 (CoinModelUseful2.cpp:888)
 ==1299==    by 0x460C8C:
 _ZL7yyparseRP6symrecPKcRPcRiPKdRK13CoinModelHashS6_dS6_R7YYSTYPES6_
 (CoinModelUseful2.cpp:1080)
 ==1299==    by 0x461600: CoinModel::getDoubleFromString(CoinYacc&, char
 const*) (CoinModelUseful2.cpp:1470)
 ==1299==    by 0x44E476: CoinModel::computeAssociated(double*)
 (CoinModel.cpp:1780)
 ==1299==    by 0x44E626: CoinModel::createArrays(double*&, double*&,
 double*&, double*&, double*&, int*&, double*&) (CoinModel.cpp:1804)
 ==1299==    by 0x450269: CoinModel::writeMps(char const*, int, int, int,
 bool) (CoinModel.cpp:1885)
 ==1299==    by 0x40F2AC: CoinModelUnitTest(std::string const&, std::string
 const&, std::string const&) (CoinModelTest.cpp:608)
 ==1299==    by 0x42B980: main (unitTest.cpp:174)
 ==1299==
 ==1299== LEAK SUMMARY:
 ==1299==    definitely lost: 146 bytes in 4 blocks.
 ==1299==    indirectly lost: 678 bytes in 38 blocks.
 ==1299==      possibly lost: 0 bytes in 0 blocks.
 ==1299==    still reachable: 0 bytes in 0 blocks.
 ==1299==         suppressed: 0 bytes in 0 blocks.
 }}}

-- 
Ticket URL: <https://projects.coin-or.org/CoinUtils/ticket/50>
COIN-OR Common Utilities <http://projects.coin-or.org/CoinUtils>
Common data structures and linear algebra functions for COIN-OR projects



More information about the CoinUtils-tickets mailing list