From: "Bernd Oppolzer" <bernd.oppolzer@T-ONLINE.DE>
Sent: Thursday, 21 June 2012 6:42 AM
> we have a problem in one of our batch PL/1 programs. After doing some work,
> the program enters a loop, consuming CPU but doing no further useful work.
> I was asked to examine the problem. We have several hundred modules around,
> and it seems that the problem could be a short on storage condition due
> to some
> module which allocates storage and doesn't free it.
1. You don't say how storage is acquired, but if it is through ALLOCATE statements,
then you need to have an ON STORAGE (with SNAP) statement,
and to deal with it in the ON unit.
2. The ON ERROR statements need to include SNAP.
Without SNAP, you won't get any notification that an error has, in fact,
occurred (if it ever did).
3. If these don't show that any error occurred, then you have a loop elsewhere
in the code that's unrelated to either STORAGE or any kind of trappable error.
> But there is no ABEND or DUMP.
> I now discovered a module with the following coding in it:
> ON ERROR BEGIN;
> ON ERROR GOTO ENDE;
> ... do some error handling,
> which can IMO lead to further errors ....
If that is so, then they will be trapped and control passes to ENDE,
which is safe.
> CALL FUNCTION /* which probably leads to an ERROR condition */;
If it does, it will be trapped by the above, and -- if necessary, pass control
> ON ERROR BEGIN;
> ON ERROR SYSTEM:
> ... do another kind of error handling ...
> This looks pretty strange to me. Can you imagine that this coding leeds
> to an endless loop, if there is an ERROR condition, followed by a short on
> storage situation?
> This is NOT the main routine, but a lower level routine which is
> dynamically called.
> I asked the co-worker, who is responsible for this, to eliminate the ON
> ERROR units.
Needs to add SNAP to the ON statements.
> from this module, because I would prefer to have an ABEND, so that I can
> the situation and - maybe - the size and the contents of the storage
> areas which lead
> to the short on storage situation.
> Do you have further suggestions to clear the situation?
After changing ON statements as suggested above, and eliminating that as a
possible cause, need to enable SUBSCRIPTRANGE, STRINGRANGE, STRINGSIZE, SIZE,