This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Unwinding stack under HPUX


Hi,

Please help,
I am porting a fortran numerical application to HPUX 11.0 from
OPENVMS.
Under VMS, LIB$ESTABLISH Allows one to set up
an exception handler. and when the handler invoked
under exceptions such as divide by zero, one can issue another
command $UNWIND to unwind the stack.
I am trying to do similar things under HPUX.
I have two approcahes.
1. FORTRAN ONLY APPROACH.
   HP FORTRAN 90 offers "ON statement" to setup exception handler.
   But there does not seem to be another routine to unwind the stack.
MIXED LANGUAGE - FORTRAN AND C.
>From a fortran code module  I call a wrapper (in The C code Module)to set up 
a handler for the exception of interest signal (i.e signal(SIGFPE, 
sig_handler) and fesettrapenable(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
and call another wrapper to setjmp(). From my exception handler
in the C module, I issue longjmp() to unwind stack (i,e to rteturn to
the state of the program when setjmp() was called).
I have two problems.
1. Successive call to setjmp does not work. (e.g firstime
   setjmp returns a value different from zero, which is fine,
   but any further call to setjmp() returns 0.
I am puzzled.
Please help.
Cheers


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]