|
Boost : |
Subject: Re: [boost] [thread] thread_proxy's catch(...) destroys my stack info for unhandled exceptions
From: Roberto Gimenez (chilabot_at_[hidden])
Date: 2008-12-27 14:20:43
Ulrich Eckhardt <doomster <at> knuut.de> writes:
>
> On Friday 26 December 2008 20:49:55 Roberto Gimenez wrote:
> > When some unhandled exception is thrown inside my function, it would be
> > good that is isn't actually handled, so I could collect the stack info
> > from the core-dump.
>
> There was a thread "[Thread] Win32 exception handling", starting 2008-11-25,
> which had exactly this behaviour as reason. Before rehashing every argument
> over, I would suggest reading that.
>
> > So why is:
> >
> > catch(...)
> > {
> > std::terminate();
> > }
> >
> > there? It looks unnecesary.
>
> I think it is necessary for environments where std::terminate is not called
> automatically, but that is no excuse for doing it unconditionally.
You are right about that. There should be a macro flag or a bool flag that
anyone could set if he wants that catchall to exist, cause with that
catchall you lose your stack info.
Navigating through the SVN I discovered that the last modification
(4 weeks ago) of the file https://svn.boost.org/trac/boost/browser/trunk
libs/thread/src/pthread/thread.cpp is the removal the catchall! ("Removed
controversial catch(...) clauses from thread class"):
135 // Removed as it stops the debugger identifying the cause of the
exception
136 // Unhandled exceptions still cause the application to terminate
137 // catch(...)
138 // {
139 // std::terminate();
140 // }
Is that modification going to be available in the next boost release? (I
really hope so).
>
> Uli
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk