Title: | DECthreads Conference |
Moderator: | PTHRED::MARYS TE ON |
Created: | Mon May 14 1990 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1553 |
Total number of notes: | 9541 |
Hello, I just 'received' a C++ program that uses DEC Threads. The whole program is mixing standard exception handling try/catch with DEC Threads exception handling TRY/CATCH_ALL/ENDTRY. I personnaly don't like this mix of styles and tried to replace everything with C++ error handling. But finally it does not work, it seems that C++ error handling does not trap all the errors. For example my error handler for a thread does not catch Segmentation fault This kind of error is well catched with TRY/CATCH_ALL/ENDTRY. Is there any solution where I only use C++ exception handling ? Thanks in advance, Regards, Remy Bianchi. [Posted by WWW Notes gateway]
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1535.1 | DCETHD::BUTENHOF | Dave Butenhof, DECthreads | Wed Apr 30 1997 11:39 | 14 | |
We've talked with the C++ folks about this before, and I recall some suggestion that they were thinking about providing some way to trap "foreign" exceptions using catch. But, currently, C++ catches only C++ exceptions. However, although you can't "catch" the exceptions, all of your destructors will run, which is usually what's really important. Besides, while there's some value to making SIGSEGV run destructors (although there's no guarantee everything will work), there's very little value to catching a SIGSEGV. It usually signals some sort of serious problem (often a nasty asynchronous data corruptor) that will probably prevent the process from operating correctly anyway. /dave | |||||
1535.2 | catch and throw | DECC::SEIGEL | Thu May 01 1997 10:55 | 5 | |
You can catch the SIGSEGV signal and throw a C++ exception from your SIGSEGV signal handler. The exception will then be properly handled as a normal C++ exception. Harold | |||||
1535.3 | Be careful about "changing" exceptions. | WTFN::SCALES | Despair is appropriate and inevitable. | Mon May 05 1997 15:29 | 13 |
.2> You can catch the SIGSEGV signal and throw a C++ exception .2> from your SIGSEGV signal handler. The exception will then be properly .2> handled as a normal C++ exception. Be aware, however, that if you do this, anything using the DECthreads TRY/CATCH macros will not recognise the resulting exception as a SEGV, and this may result in unexpected and counterintuitive behavior. (E.g., if your handler is in an RPC server, then a SEGV during an RPC call will not be reflected back to the client side correctly...but, with such a potentially catastrophic failure as a SEGV, you may not care... :-} ) Webb |