I have a lot of experience with catching signals in a "conventional MVS" 
started task written in C++. (Signal handling is a C function but also 
available in C++.) In my experience the signal handler was perfect at catching 
S0C4 type exceptions with SIGSEGV.

That said, as @Joe says, the C signal handling is not real conducive to "make 
note of the problem and continue on where you were" processing. 

If you want to do that I think you are either going to have to figure out how 
to make it happen with longjmp() (with which I have no experience: I think 
perhaps it is not a C++ thing) or else hack your way through TRAP(NOSPIE) and 
writing your on ESPIE invocation and handler in assembler.

The latter is more or less what I did, but for the more complex situation of 
ESTAEX. I no longer "own" the code I wrote to do that and so I am not at 
liberty to share it.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Jantje.
Sent: Tuesday, October 19, 2021 8:04 AM
To: [email protected]
Subject: C signal() and abends not being signaled

Esteemed listers,

I have the situation that in the vast majority of cases the C program just 
works fine, but in an infinitesimal small number of cases, it gets a S0C4 
abend. I could perhaps, through intricate testing and comparing of lots of 
things -- and burning huge amounts of CPU in doing so -- prevent the abend from 
happening, but I would rather avoid the cost of that testing and instead 
privilege the normal case.

So, I thought to use the signal() function to take control in those very few 
cases where the abend occurs.

However...

signal or no signal, LE takes that CEEDUMP and the program stops, no matter 
what.

What am I missing?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to