RE: exception handling on Unix

Posted by Xavier.Abulker on
URL: http://quantlib.414.s1.nabble.com/Re-exception-handling-on-Unix-tp2571p2572.html

Hi Luigi

If I change

class Error : public std::runtime_error {
      public:
        explicit Error(const std::string& what = "") :
std::runtime_error(what) {
             }
to

class Error : public std::runtime_error {
      public:
        explicit Error(const std::string& what = "") :
std::runtime_error(what) {
       std::cout<<"in Error"<<std::endl;
             }
then I see the error message "In Error" and the core dumped.

I think It has never worked correclty on Unix, I've always seen the core
dump instead of the error message but now I'm trying to link QuantLib with
Java via JNI and that's not possible if I can't access to exceptions.

Thanks for the time you spent on this issue.
Regards
Xavier



                                                                                                                     
                    Luigi Ballabio                                                                                  
                    <luigi.ballabio@fast       To:     [hidden email]                                      
                    webnet.it>                 cc:     [hidden email]                          
                                               Subject:     RE: [Quantlib-users] exception handling on Unix          
                    23/06/2003 15:31                                                                                
                                                                                                                     
                                                                                                                     




At 01:30 PM 6/23/03 +0200, [hidden email] wrote:
>there's still the core dump.
>
>Using DDD debugger this is what I see:
>
>2) Go to explicit Error(const std::string& what = "") :
>std::runtime_error(what) in errors.hpp and ends with
>
>Program received signal SIGABRT, Aborted.
>0xfeb9c724 in _libc_kill () from /usr/lib/libc.so.1

Ouch.

Can you try and put a print statement inside the Error constructor body to
see if the base class completes initialization?
Also, have you any idea about when this behavior appeared? After updating
QuantLib? Or some other tool? (gcc and stuff)

Later,
         Luigi






*************************************************************************
Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration.
La Fimat et ses filiales declinent toute responsabilite au
titre de ce message s'il a ete altere, deforme ou falsifie.
                    ********
This message and any attachments (the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
E-mails are susceptible to alteration.
Neither Fimat nor any of its subsidiaries or affiliates shall
be liable for the message if altered, changed or falsified.
*************************************************************************