catching access violation, compiler settings and xl addin crash.

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

catching access violation, compiler settings and xl addin crash.

P Nelnik
Good morning all,

Due to the current quantlib compiler settings, access violations are not caught with catch(...)
as a result we can have some rather ungraceful crashes.

I wonder are there reasons why the settings are the way they are?

I'd suggest changing the settings.
To do this in MS Visual C++ 2008, click on:
   Project -> Properties -> Configuration Properties -> C/C++ -> Code Generatoin
and set: 
   Enable C++ Exceptions 
to
   Yes With SEH Exceptions (/EHa)
rather than
   Yes ( /EHsc)

Here are some details of the compiler settings:
      http://msdn.microsoft.com/en-us/library/1deeycx5.aspx

Right now, when I use the quantlib XL addin in excel ( 2007 ) as excel is closes it crashes ( almost always).
There are two problems with this,
1: some error is thrown
2: the error is not caught

By changing the settings above we can at least solve number 2.

Cheers
Philip


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: catching access violation, compiler settings and xl addin crash.

Luigi Ballabio
On Fri, 2010-06-11 at 09:49 +0800, P Nelnik wrote:
> Due to the current quantlib compiler settings, access violations are
> not caught with catch(...)
> as a result we can have some rather ungraceful crashes.
>
> I wonder are there reasons why the settings are the way they are?

I don't think there's a particular reason.  It might have been ported
from an earlier compiler version, or the compiler defaults.  We just
didn't give it much thought.


> I'd suggest changing the settings.
> To do this in MS Visual C++ 2008, click on:
>    Project -> Properties -> Configuration Properties -> C/C++ -> Code
> Generatoin
> and set:  
>    Enable C++ Exceptions  
> to
>    Yes With SEH Exceptions (/EHa)
> rather than
>    Yes ( /EHsc)

Ok, I'll do it for next release.  Does the setting just add some
error-catching code, or is there any binary-compatibility issue to be
aware of?

Luigi


--

Steinbach's Guideline for Systems Programming:
Never test for an error condition you don't know how to handle.



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev