- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Porting from TRU64: structured exception handling
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2009 06:47 AM
тАО03-25-2009 06:47 AM
I am migrating an application from TRU64 to HPUX. The source includes excpt.h and uses the function "exc_raise_signal_exception" as a signal handler for SIGSEGV. HP UX doesnt have this header file. Can any one pls guide me what is the alternative. One alternative could be writing a custom signal handler that throws exceptions.
Thanks in advance .....
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2009 12:19 PM
тАО03-25-2009 12:19 PM
Solution>could be writing a custom signal handler that throws exceptions.
Also the C++ Standard doesn't support throwing from a signal handler. While not disallowed by the aC++ runtime, the results are unpredictable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2009 02:08 PM
тАО03-26-2009 02:08 PM
Re: Porting from TRU64: structured exception handling
Thanks for the reply. Seems I need to take out the signal handling out of the existing code. Also, I need to compile the source for Itanium. I also read your article : http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=c5080055abe021100055abe02110275d6e10RCRD
Acc to your article, throwing out of a signal handler is not at all possible on itanium.
So was wondering, is there any other way I can simulate the functionality on hp ux. Will try this: catch the signal, set a flag and return from the signal handler. And based on the flag throw an exception. Will try to code this and post the results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2009 11:26 PM
тАО03-26-2009 11:26 PM
Re: Porting from TRU64: structured exception handling
That's the only way to be supported.
>I need to compile the source for Integrity.
Things have changed since that was first written but it is still unsupported.
I guess it depends on close you want to skate to thin ice. ;-)
>is there any other way I can simulate the functionality on HP-UX? Will try this: catch the signal, set a flag and return from the signal handler.
No. Only by trying a throw and hope your opt level, where it aborts isn't too high.
Otherwise if you return you will get the trap again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2009 05:49 AM
тАО03-27-2009 05:49 AM
Re: Porting from TRU64: structured exception handling
I tried writing the following code with setjmp/longjmp. Assuming that I call the setjmp/longjump at the correct places, what other dangers could happen with this code. Thanks again for the replies ....
--------------------------------------
#include
#include
#include
int error=0;
jmp_buf jbuff;
struct sigaction foo;
void hand_x(int sig, siginfo_t *siginf, void *ptr){
printf("inside hanldler\n");
error =1;
longjmp(jbuff,sig);
}
main()
{
struct sigaction foo = {hand_x,0,0};
sigaction(SIGSEGV,&foo,0);
char * a= "hello";
try
{
setjmp(jbuff);
if(error == 1)
throw 1;
a[10]='a'; //Segmentation fault here
}
catch(...)
{
printf("exception raised\n");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2009 03:48 PM
тАО03-27-2009 03:48 PM
Re: Porting from TRU64: structured exception handling
If you read the Release Notes, you'll also find that's not supported either with C++.
http://docs.hp.com/en/B3901-90031/ch05s08.html#v2649446
http://docs.hp.com/en/B3901-90031/ch05s08.html#v2649455
Your variable "error" isn't volatile and since setjmp returns a value, you should test that and not "error".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2009 07:07 AM
тАО03-30-2009 07:07 AM
Re: Porting from TRU64: structured exception handling
We are removing the signal handling from code, although this means at runtime we are going to get lots of dumps !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2009 04:11 PM
тАО03-30-2009 04:11 PM
Re: Porting from TRU64: structured exception handling
Do you know why you have bad pointers?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 02:34 AM
тАО04-14-2009 02:34 AM
Re: Porting from TRU64: structured exception handling
>>Do you know why you have bad pointers?
No .. Even going through the tons of source doesnt help.. I guess we have to fix the cause of the dumps as and when we get them.
Thanks a lot ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 03:42 AM
тАО04-14-2009 03:42 AM
Re: Porting from TRU64: structured exception handling
You didn't fix these completely when running under Tru64?