bugPsychosynth - Bugs: bug #36222, Catch exceptions in main()?

 
 

bug #36222: Catch exceptions in main()?

Submitted by:  Markus Elfring <elfring>
Submitted on:  Tue 17 Apr 2012 10:58:33 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Tue 17 Apr 2012 05:25:43 PM UTC, comment #7:

Do you find another reference for the exception handling mechanism appropriate here?

Markus Elfring <elfring>
Tue 17 Apr 2012 03:30:35 PM UTC, comment #6:

Do answers for the question "Why destructor is not called on exception?" contain information that is also useful for you?

Markus Elfring <elfring>
Tue 17 Apr 2012 03:20:25 PM UTC, comment #5:

Can you point me to the part of the standard stating that the stack is not unwinded if an exception escapes main()?

Juan Pedro Bolivar Puente <raskolnikov>
Project Administrator
Tue 17 Apr 2012 12:50:54 PM UTC, comment #4:

Would you like to achieve complete stack-unwinding and corresponding clean-ups for your software objects during exception handling?

Markus Elfring <elfring>
Tue 17 Apr 2012 12:44:21 PM UTC, comment #3:

Why should the way the program crashes matter? Maybe if bug reporting is introduced in the future, such a handler will be added. So far, whatever the compiler implementer decides to add as default terminate handler is fine for me.

On the other hand, GCC 4.6 or greater is the only supported compiler right now because of our usage of C++0x features.

Juan Pedro Bolivar Puente <raskolnikov>
Project Administrator
Tue 17 Apr 2012 12:25:09 PM UTC, comment #2:

The handling of uncaught/unhandled exceptions might be acceptable from a few popular C++ compilers. But it is not portable as you might hope.
Would you really like to depend on implementation-defined behaviour?

Markus Elfring <elfring>
Tue 17 Apr 2012 12:11:56 PM UTC, comment #1:

There a "fatal" exception handler for psynth::base::exceptions and the root of the callgraph here:

http://bzr.savannah.gnu.org/lh/psychosynth/trunk/annotate/head:/src/psynth/app/psynth_app.cpp

For other kinds of exceptions, they should be cought in other places in the main loop. If they scape the main loop, this is a bug and it is better that they call terminate such that a backtrace can be seen in gdb.

Juan Pedro Bolivar Puente <raskolnikov>
Project Administrator
Tue 17 Apr 2012 10:58:33 AM UTC, original submission:

I expect that exception handling is usually supported by a C++ program. I wonder why your main() functions do not contain corresponding try and catch instructions so far.

How do you think about the recommendations by Matthew Wilson in the article "Quality Matters #6: Exceptions for Practically-Unrecoverable Conditions"?

Would you like to adjust the implementation of your main() functions if you consider effects for uncaught/unhandled exceptions like they are described by Bruce Eckel?

Markus Elfring <elfring>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by raskolnikov (Posted a comment)
  • -unavailable- added by elfring (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup