Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Clean exit on signal

807575May 18 2001 — edited Jun 18 2001
We're in the process of moving to C++ 5.1/WorkShop 6 from 4.2. Under 4.2 our apps trapped certain UNIX signals, and threw an exception. This allowed our apps to cleanly shutdown as the stack was unwound and destructors invoked.

This no longer works in 5.1 (the manual explicitly says not to throw exceptions from signal handlers). Is there a clean way to "re-enter" the C++ environment from a signal handler so we can throw an exception?

We have tried throwing from the signal handler in 5.1, and the signal is not picked up by any catch block, not one typed explicitly for this exception, and not even catch(...). I have not attempted to check if stack unwinding is occuring, as the catch problem is a showstopper.

We chose to use an exception under 4.2 as we had already coded our apps to shut down cleanly on an unexpected exception.

Any thoughts on how to handle this? The docs say to set a flag in the signal handler and have the C++ code poll the flag. This is a very intrusive way of dealing with it.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 16 2001
Added on May 18 2001
8 comments
291 views