Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner

GETEXCEPTIONPTRSQQ returns NULL

Dear All,

I implemented an exception handler and registered it with SIGNALQQ. Within this exception handler I want to call TRACEBACKQQ function with EPTR option. Unfortunately GETEXCEPTIONPTRSQQ() function returns NULL. Does anyone of you have an idea why? Thank you for your time in advance.

Best regards,

Baris Irhan,

 

integer(4) function h_fpe (signum,ecode)
!DIR$ ATTRIBUTES C :: h_fpe
!params
integer(2) :: signum
integer(2) :: ecode
!variables
integer(4) :: RTN_STS
integer(KIND=INT_PTR_KIND()) :: EPTRS
include 'FOR_IOSDEF.FOR'

!body

!write(*,'(/,A)') 'in signal handler for sig$fpe'
!write(*,*) 'signum = ', signum
!write(*,*) 'ecode = ', ecode    
!read(*,*)

EPTRS = GETEXCEPTIONPTRSQQ()
call TRACEBACKQQ(USER_EXIT_CODE=-1,STATUS=RTN_STS,EPTR=EPTRS)

if (RTN_STS .EQ. FOR$IOS_SUCCESS) then
write(*,*) 'TRACEBACK WAS SUCCESSFUL'
read(*,*)
end if

h_fpe = 1
end

 

 

0 Kudos
3 Replies
Highlighted

I would try adding USE IFCORE

I would try adding USE IFCORE to your program so that GetExceptionPtrsQQ is properly defined.

It's possible that the return value is being interpreted as a REAL, being converted to INTEGER before being stored in EPTRS, and weird things are happening.

               I hope this helps --

                                    --Lorri

0 Kudos
Highlighted
Beginner

Dear Lorri,

Dear Lorri,

I defined event handler as a module procedure. use IFCORE has already been added at module declaration...

0 Kudos
Highlighted
Beginner

Dear Colleques,

Dear Colleques,

I am still NOT able to figure out why GETEXCEPTIONPTRSQQ function returns NULL when it is called within exception handler. Why I am not able to use this nice feature...

 

0 Kudos