Re: 0.3.12 test tarballs

Posted by eric ehlers on
URL: http://quantlib.414.s1.nabble.com/0-3-12-test-tarballs-tp10998p11003.html

Hi Klaus

On 2/22/06, Klaus Spanderen <[hidden email]> wrote:
> Hi Nando
>
> I checked testLambdaBootstrapping using VC 8 Express, Boost 1.33.1. My
> configuration does not report a memory leak;-(. Can you please send my the
> line number of the memory leak as reported by VC 8 Professional?

I don't know about VC8 Pro but valgrind detects the memory leak at
line 95 of libormarketmodelprocess.cpp, the full output is below.

I haven't had time to investigate further but a first guess would be
that maybe the shared pointer to the LiborForwardModelProcess object
is used incorrectly such that the reference counting is circumvented
preventing the object from being deleted when the pointer goes out of
scope.

Regards,
Eric

==13056== Memcheck, a memory error detector.
==13056== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==13056== Using LibVEX rev 1471, a library for dynamic binary translation.
==13056== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==13056== Using valgrind-3.1.0, a dynamic binary instrumentation framework.
==13056== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==13056== For more details, rerun with: -v
==13056==
==13056== My PID = 13056, parent PID = 3158.  Prog and args are:
==13056==    lt-quantlib-test-suite
==13056==
==13056==
==13056== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 21 from 1)
==13056== malloc/free: in use at exit: 52,152 bytes in 84 blocks.
==13056== malloc/free: 87,206,644 allocs, 87,206,560 frees,
3,900,805,716 bytes allocated.
==13056== For counts of detected errors, rerun with: -v
==13056== searching for pointers to 84 not-freed blocks.
==13056== checked 1,230,908 bytes.
==13056==
==13056== 1,680 bytes in 1 blocks are possibly lost in loss record 15 of 28
==13056==    at 0x43CA7F8: operator new(unsigned) (vg_replace_malloc.c:164)
==13056==    by 0x8A7A7A: std::__default_alloc_template<true,
0>::_S_chunk_alloc(unsigned, int&) (in /usr/lib/libstdc++.so.5.0.7)
==13056==    by 0x8A798C: std::__default_alloc_template<true,
0>::_S_refill(unsigned) (in /usr/lib/libstdc++.so.5.0.7)
==13056==    by 0x8A7687: std::__default_alloc_template<true,
0>::allocate(unsigned) (in /usr/lib/libstdc++.so.5.0.7)
==13056==    by 0x8AD017: std::string::_Rep::_S_create(unsigned,
std::allocator<char> const&) (in /usr/lib/libstdc++.so.5.0.7)
==13056==    by 0x4415094: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&,
std::forward_iterator_tag) (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x44154C4:
boost::unit_test_framework::retrieve_framework_parameter(char const*,
int*, char**) (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x441CC26: main (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==
==13056==
==13056== 2,192 (224 direct, 1,968 indirect) bytes in 2 blocks are
definitely lost in loss record 16 of 28
==13056==    at 0x43CA7F8: operator new(unsigned) (vg_replace_malloc.c:164)
==13056==    by 0x821683D: (anonymous
namespace)::makeProcess(QuantLib::Matrix const&)
(libormarketmodelprocess.cpp:95)
==13056==    by 0x8217F33:
LiborMarketModelProcessTest::testMonteCarloCapletPricing()
(libormarketmodelprocess.cpp:226)
==13056==    by 0x80B7F35:
boost::unit_test_framework::function_test_case::do_run()
(unit_test_suite.hpp:138)
==13056==    by 0x441748C:
boost::unit_test_framework::detail::unit_test_monitor::function() (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x44115EA: (within
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x440FF30: boost::execution_monitor::execute(bool,
int) (in /usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x4417317:
boost::unit_test_framework::detail::unit_test_monitor::execute_and_translate(boost::unit_test_framework::test_case*,
void (boost::unit_test_framework::test_case::*)(), int) (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x441B8FB:
boost::unit_test_framework::test_case::run() (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x441C0B4:
boost::unit_test_framework::test_suite::do_run() (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x441BA90:
boost::unit_test_framework::test_case::run() (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x441C0B4:
boost::unit_test_framework::test_suite::do_run() (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==
==13056==
==13056== 1,240 (44 direct, 1,196 indirect) bytes in 1 blocks are
definitely lost in loss record 18 of 28
==13056==    at 0x43CA7F8: operator new(unsigned) (vg_replace_malloc.c:164)
==13056==    by 0x82121BF:
boost::detail::shared_count::shared_count<QuantLib::LiborForwardModelProcess*,
boost::checked_deleter<QuantLib::LiborForwardModelProcess>
>(QuantLib::LiborForwardModelProcess*,
boost::checked_deleter<QuantLib::LiborForwardModelProcess>)
(shared_count.hpp:341)
==13056==    by 0x8210C1C:
boost::shared_ptr<QuantLib::LiborForwardModelProcess>::shared_ptr<QuantLib::LiborForwardModelProcess>(QuantLib::LiborForwardModelProcess*)
(shared_ptr.hpp:126)
==13056==    by 0x8216884: (anonymous
namespace)::makeProcess(QuantLib::Matrix const&)
(libormarketmodelprocess.cpp:95)
==13056==    by 0x8217F80:
LiborMarketModelProcessTest::testMonteCarloCapletPricing()
(libormarketmodelprocess.cpp:228)
==13056==    by 0x80B7F35:
boost::unit_test_framework::function_test_case::do_run()
(unit_test_suite.hpp:138)
==13056==    by 0x441748C:
boost::unit_test_framework::detail::unit_test_monitor::function() (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x44115EA: (within
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x440FF30: boost::execution_monitor::execute(bool,
int) (in /usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x4417317:
boost::unit_test_framework::detail::unit_test_monitor::execute_and_translate(boost::unit_test_framework::test_case*,
void (boost::unit_test_framework::test_case::*)(), int) (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x441B8FB:
boost::unit_test_framework::test_case::run() (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==    by 0x441C0B4:
boost::unit_test_framework::test_suite::do_run() (in
/usr/local/lib/libboost_unit_test_framework-gcc-1_31.so.1.31.0)
==13056==
==13056== LEAK SUMMARY:
==13056==    definitely lost: 268 bytes in 3 blocks.
==13056==    indirectly lost: 3,164 bytes in 24 blocks.
==13056==      possibly lost: 1,680 bytes in 1 blocks.
==13056==    still reachable: 47,040 bytes in 56 blocks.
==13056==         suppressed: 0 bytes in 0 blocks.
==13056== Reachable blocks (those to which a pointer was found) are not shown.
==13056== To see them, rerun with: --show-reachable=yes