critical impact:
DCE exceptions - not available (CrUn79)
Problem description
DCE-style C language exception support exists on Tru64 UNIX, but not on HP-UX.
On Tru64 UNIX, POSIX cancellation (pthread_cancel) and thread exit (pthread_exit) are implemented using cross-language exception support built into the operating system. Unhandled synchronous signals (including SIGSEGV) are by default converted into exceptions. POSIX cancel or thread exit can also be caught as exceptions, in addition to the POSIX standard mechanism using pthread_cleanup_push and pthread_cleanup_pop (implemented using exception handling on Tru64 UNIX). Identifiers
 CATCH |
 pthread_exc_raise_np |
 CATCH_ALL |
 pthread_exc_raise_status_np |
 ENDTRY |
 pthread_exc_report_np |
 FINALLY |
 pthread_exc_resaddr_e |
 pthread_exc_aritherr_e |
 pthread_exc_resoper_e |
 pthread_exc_cancel_e |
 pthread_exc_set_status_np |
 pthread_exc_decovf_e |
 pthread_exc_SIBIOT_e |
 pthread_exc_excpu_e |
 pthread_exc_SIGABRT_e |
 pthread_exc_exfilsiz_e |
 pthread_exc_SIGBUS_e |
 pthread_exc_exit_e |
 pthread_exc_SIGEMT_e |
 pthread_exc_exquota_e |
 pthread_exc_SIGFPE_e |
 pthread_exc_fltdiv_e |
 pthread_exc_SIGILL_e |
 pthread_exc_fltovf_e |
 pthread_exc_SIGPIPE_e |
 pthread_exc_fltund_e |
 pthread_exc_SIGSEGV_e |
 pthread_exc_get_message_np |
 pthread_exc_SIGSYS_e |
 pthread_exc_get_status_np |
 pthread_exc_SIGTRAP_e |
 pthread_exc_illaddr_e |
 pthread_exc_stackovf_e |
 pthread_exc_illinstr_e |
 pthread_exc_subrng_e |
 pthread_exc_insfmem_e |
 pthread_exc_uninitexc_e |
 pthread_exc_intdiv_e |
 pthread_exception.h |
 pthread_exc_intovf_e |
 RAISE |
 pthread_exc_matches_np |
 RERAISE |
 pthread_exc_noexcmem_e |
 THIS_CATCH |
 pthread_exc_nopriv_e |
 TRY |
 pthread_exc_privinst_e |
|
Old behavior
TRY call_foo(); CATCH_ALL {printf ("Failed\n");} ENDTRY See also
Solution description
To perform cleanup operations on cancellation or thread exit, use the POSIX standard operations pthread_cleanup_push and pthread_cleanup_pop. To handle synchronous signals, use sigaction to register a signal-catching function.
HP-UX does not support exceptions within the C language. It is not possible for the C language code to prevent termination of a cancelled thread by catching the cancel; it can only clean up using a cleanup handler, and return to continue the termination. (This is equivalent to the behavior of the FINALLY macro, or a C++ object destructor.) New behavior
pthread_cleanup_push (handler, NULL); call_foo(); pthread_cleanup_pop (0); See also
Problem summary
| classifications |
source types |
OS release |
severity |
type |
| TH |
C, C++ |
any HP-UX 11i version |
critical |
unavailable |
|