test suite fails when run in debug mode but is successful when run in release mode

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

test suite fails when run in debug mode but is successful when run in release mode

Rahul Reddy Kanchi
Hi All,
I have this wierd problem when running test suite. An exception is thrown when testsuite is run in debug mode. But when run in release mode it is successfull as some of the asserts are skipped in release mode.

Note: I have checked out latest quantlib using tortoiseSVN and built it. Finally when i ran testsuite, an exception is thrown. Stack trace is attached. Could you please let me know if this a known behavior.

Error Message:
==========
First-chance exception at 0x763cc83b in QuantLib-test-suite-vc100-mt-gd.exe: Microsoft C++ exception: QuantLib::Error at memory location 0x0017a008..

Stack trace is shown below:
=====================
ThrowException
QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::TermStructure::checkRange(double t, bool extrapolate) Line 77 
QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::YieldTermStructure::discount(double t, bool extrapolate) Line 93
QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::YieldTermStructure::discount(const QuantLib::Date &d, bool extrapolate) Line 188
QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::DiscountingSwapEngine::calculate() Line 94
QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::Instrument::performCalculations() Line 168
QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::LazyObject::calculate() Line 140
QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::Instrument::calculate() Line 155
QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::AssetSwap::fairCleanPrice() Line 221
QuantLib-test-suite-vc100-mt-gd.exe!AssetSwapTest::testConsistency() Line 163
......
.....

------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: test suite fails when run in debug mode but is successful when run in release mode

Luigi Ballabio
On Mon, 2011-07-18 at 22:47 +0100, Rahul Reddy Kanchi wrote:
> Hi All,
> I have this wierd problem when running test suite. An exception is
> thrown when testsuite is run in debug mode. But when run in release
> mode it is successfull as some of the asserts are skipped in release
> mode.

No, I don't think it's a skipped assert.  From the stack trace below,
the exception is thrown at line 94 of
<ql/pricingengines/swap/discountingengine.cpp>, but it should be caught
a couple of lines later and execution should continue (as it does in
release mode.)

When the exception is thrown, does the program stop, or does it just
enter the debugger? If the latter, do you have the option to continue
execution, and what happens then?

Luigi


> Note: I have checked out latest quantlib using tortoiseSVN and built
> it. Finally when i ran testsuite, an exception is thrown. Stack trace
> is attached. Could you please let me know if this a known behavior.
>
>
> Error Message:
> ==========
> First-chance exception at 0x763cc83b in
> QuantLib-test-suite-vc100-mt-gd.exe: Microsoft C++ exception:
> QuantLib::Error at memory location 0x0017a008..
>
>
> Stack trace is shown below:
> =====================
> ThrowException
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::TermStructure::checkRange(double t, bool extrapolate) Line
> 77
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::YieldTermStructure::discount(double t, bool extrapolate)
> Line 93
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::YieldTermStructure::discount(const QuantLib::Date &d, bool
> extrapolate) Line 188
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::DiscountingSwapEngine::calculate() Line 94
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::Instrument::performCalculations() Line 168
> QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::LazyObject::calculate()
> Line 140
> QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::Instrument::calculate()
> Line 155
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::AssetSwap::fairCleanPrice() Line 221
> QuantLib-test-suite-vc100-mt-gd.exe!AssetSwapTest::testConsistency()
> Line 163
> ......
> .....
> ------------------------------------------------------------------------------
> Storage Efficiency Calculator
> This modeling tool is based on patent-pending intellectual property that
> has been used successfully in hundreds of IBM storage optimization engage-
> ments, worldwide.  Store less, Store more with what you own, Move data to
> the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
> _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev

--

The surest way to make a monkey of a man is to quote him.
-- Robert Benchley



------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: test suite fails when run in debug mode but is successful when run in release mode

Rahul Reddy Kanchi
Hi Luigi,

It enters a debugger and prompts for continue/break/ignore. But the same exception is thrown several times(may be in hundreds). Looks like the exception is thrown in checkRange() function. Time variable is -ve but we are checking it through QL_REQUIRE(t>0) and thus exception is thrown. 

Test suite execution in release mode took more than an hour. Is this a normal behavior?
14>  Tests completed in 1 h 26 m 40 s
14>  
14>  
14>  Test suite "Master Test Suite" passed with:
14>    1718 assertions out of 1718 passed
14>    475 test cases out of 475 passed
14>  


Exception Stack trace:
==================
QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::TermStructure::checkRange(double t, bool extrapolate)  Line 77 + 0xed bytes C++
  QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::YieldTermStructure::discount(double t, bool extrapolate)  Line 93 C++
  QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::YieldTermStructure::discount(const QuantLib::Date & d, bool extrapolate)  Line 188 C++
  QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::DiscountingSwapEngine::calculate()  Line 94 + 0x39 bytes C++
  QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::Instrument::performCalculations()  Line 168 + 0x26 bytes C++
  QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::LazyObject::calculate()  Line 140 + 0xf bytes C++
  QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::Instrument::calculate()  Line 155 C++
  QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::AssetSwap::fairSpread()  Line 195 + 0xe bytes C++
  QuantLib-test-suite-vc100-mt-gd.exe!AssetSwapTest::testMASWWithGenericBond()  Line 2059 + 0xb bytes C++
  QuantLib-test-suite-vc100-mt-gd.exe!boost::detail::function::void_function_invoker0<void (__cdecl*)(void),void>::invoke(boost::detail::function::function_buffer & function_ptr)  Line 112 + 0x5 bytes C++


Thanks,
Rahul.

On Tue, Jul 19, 2011 at 9:15 AM, Luigi Ballabio <[hidden email]> wrote:
On Mon, 2011-07-18 at 22:47 +0100, Rahul Reddy Kanchi wrote:
> Hi All,
> I have this wierd problem when running test suite. An exception is
> thrown when testsuite is run in debug mode. But when run in release
> mode it is successfull as some of the asserts are skipped in release
> mode.

No, I don't think it's a skipped assert.  From the stack trace below,
the exception is thrown at line 94 of
<ql/pricingengines/swap/discountingengine.cpp>, but it should be caught
a couple of lines later and execution should continue (as it does in
release mode.)

When the exception is thrown, does the program stop, or does it just
enter the debugger? If the latter, do you have the option to continue
execution, and what happens then?

Luigi


> Note: I have checked out latest quantlib using tortoiseSVN and built
> it. Finally when i ran testsuite, an exception is thrown. Stack trace
> is attached. Could you please let me know if this a known behavior.
>
>
> Error Message:
> ==========
> First-chance exception at 0x763cc83b in
> QuantLib-test-suite-vc100-mt-gd.exe: Microsoft C++ exception:
> QuantLib::Error at memory location 0x0017a008..
>
>
> Stack trace is shown below:
> =====================
> ThrowException
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::TermStructure::checkRange(double t, bool extrapolate) Line
> 77
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::YieldTermStructure::discount(double t, bool extrapolate)
> Line 93
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::YieldTermStructure::discount(const QuantLib::Date &d, bool
> extrapolate) Line 188
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::DiscountingSwapEngine::calculate() Line 94
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::Instrument::performCalculations() Line 168
> QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::LazyObject::calculate()
> Line 140
> QuantLib-test-suite-vc100-mt-gd.exe!QuantLib::Instrument::calculate()
> Line 155
> QuantLib-test-suite-vc100-mt-gd.exe!
> QuantLib::AssetSwap::fairCleanPrice() Line 221
> QuantLib-test-suite-vc100-mt-gd.exe!AssetSwapTest::testConsistency()
> Line 163
> ......
> .....
> ------------------------------------------------------------------------------
> Storage Efficiency Calculator
> This modeling tool is based on patent-pending intellectual property that
> has been used successfully in hundreds of IBM storage optimization engage-
> ments, worldwide.  Store less, Store more with what you own, Move data to
> the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
> _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev

--

The surest way to make a monkey of a man is to quote him.
-- Robert Benchley




------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: test suite fails when run in debug mode but is successful when run in release mode

Luigi Ballabio
On Tue, 2011-07-19 at 21:31 +0100, Rahul Reddy Kanchi wrote:
> It enters a debugger and prompts for continue/break/ignore. But the
> same exception is thrown several times(may be in hundreds). Looks like
> the exception is thrown in checkRange() function. Time variable is -ve
> but we are checking it through QL_REQUIRE(t>0) and thus exception is
> thrown.

Yes, the exception is expected.  Although we might have written the
thing as:

if (d >= discountCurve->referenceDate())
    results_.startDiscounts[i] = discountCurve_->discount(d);
else
    results_.startDiscounts[i] = Null<DiscountFactor>();

instead of:

try {
    results_.startDiscounts[i] = discountCurve_->discount(d);
} catch (...) {
    results_.startDiscounts[i] = Null<DiscountFactor>();
}

If you want to make the change and check that the test suite still
works, by all means do (and send me the patch afterwards.)


> Test suite execution in release mode took more than an hour. Is this a
> normal behavior?

It takes around half an hour on my machine (I have two 1.83GHz cores,
but the test suite only uses one.)  I'm using gcc on Linux, but I think
the times on a comparable Windows machine were about the same...

Luigi


--

When you break the big laws, you do not get liberty; you do not
even get anarchy. You get the small laws.
-- G.K. Chesterton



------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: test suite fails when run in debug mode but is successful when run in release mode

Ferdinando M. Ametrano-3
On Fri, Jul 29, 2011 at 5:36 PM, Luigi Ballabio
<[hidden email]> wrote:

> Although we might have written the
> thing as:
>
> if (d >= discountCurve->referenceDate())
>    results_.startDiscounts[i] = discountCurve_->discount(d);
> else
>    results_.startDiscounts[i] = Null<DiscountFactor>();
>
> instead of:
>
> try {
>    results_.startDiscounts[i] = discountCurve_->discount(d);
> } catch (...) {
>    results_.startDiscounts[i] = Null<DiscountFactor>();
> }
>
> If you want to make the change and check that the test suite still
> works, by all means do (and send me the patch afterwards.)

done

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev