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

 
 

bug #36222: Catch exceptions in main()?

Submitter:  Markus Elfring <elfring>
Submitted:  Tue 17 Apr 2012 10:58:33 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 17 Apr 2012 05:25:43 PM UTC, comment #7: 
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>
Group 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>
Group 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>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code