[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: exceptions in gnu c++



On Mon, Nov 06, 2006 at 10:56:38AM +0100, Christian Holm Christensen wrote:
> Hi Paul,
> 
> On Sun, 2006-11-05 at 18:34 -0700, Paul E Condon wrote:
> > On Sun, Nov 05, 2006 at 10:51:15PM +0100, Christian Holm Christensen wrote:
> > > Hi Paul,
> ...
> > > On Sun, 2006-11-05 at 14:29 -0700, Paul E Condon wrote:
> ...
> > I have a new version of my program and I have switched to g++-3.4
> > The newer version addresses issues about the actual name of the
> > exception:
> > #include "Sys.hh"
> > #include "nmlib.hh"
> > #include "rgen2.hh"
> > #include "nmsim.hh"
> > 
> > int main( int argc, char* argv[] ){
> >   clog<<"Starting nmmain..."<<endl;
> >   try {
> >     NMsim X;                 // instantiate the simulation object
> >     X.nminit( argc, argv ); // read in parameters and generate starting conditions
> >     X.nmcore( );         // do a simulation run
> >   } 
> >   catch (...) {
> >     clog << "caught ...!!!"<< endl;
> >   }
> >   clog<<" After catch."<<endl;
> >   return 0;
> > };
> > </end>
> > 
> > The output still shows no sign that the catch block is entered.
> > Still the same 'Killed' word from somewhere.
> 
> Did you try to use GDB to figure out what's going on?  If not, give that
> a whirl.   
> 
> Also, It's kinda hard to see where your code fails when we only can see
> the few lines above.  Perhaps you should post your code on some web-site
> so that someone else can download it, compile it, and run it, to get a
> better idea of what might be wrong. 
> 
> > Should I be able to put essentially all of a program inside
> > a try block like I'm doing here? 
> 
> Yep.
> 
> > It is hard to believe that this
> > is an undiscovered bug in gnu c++. What might be missing from
> > my code? 
> 
> Don't know - we can't see most of the code!
> 
> > I've never done try/catch before so don't hesitate
> > to suggest the 'obvious'.
> 
> What you have above is fine.  However, the error is probably at some
> deeper level - say somewhere in the NMsim class.
> 
> Sorry, with out more information, it will be hard to give you any hints,
> directions, or help.  
> 

>From another list I've received the suggestion that 'Killed' is coming
from the OS, which issued it while processing a "SIGHUP". This sounds
plausible to me. For some reason, my program got itself into a state
in which it couldn't process the throwing of an exception, and couldn't
do anything else, and it got killed by the OS (Linux). 

Further investigation will have to wait for a few days. I'm a precinct
election judge and need to be ready for work all day tomorrow. And then
a day or so to recover.

Thanks for your help. 
-- 
Paul E Condon           
pecondon@mesanetworks.net



Reply to: