Oppolzer - Informatik / Stanford Pascal Compiler


Home       Lebenslauf       Schwerpunkte       Kenntnisse       Seminare       Kunden       Projekte       Produkte       Blog       Stanford Pascal       Kontakt

The Stanford Pascal Compiler / Evolution Steps

Back to Compiler main page

Changes to PASSNAP and PASSNAPC - better error handling in PASMONN

Compiler version: 05.2017

I did some more improvements to the error handling routines inside the Pascal monitor PASMONN (Mainframe version); this was inspired by the MVS SYMPTOM DUMP and by some of the more useful outputs from CEEDUMP.

See these examples:

1.) Error 0C4 when using a wrong pointer:


**** INTERRUPT PSW : 078D0004 200A54AE **** REGS 0 - 3 : 00000040 000B5530 008566B0 00000006 **** REGS 4 - 7 : 00000004 400A5A1C 00000000 800A9DE2 **** REGS 8 - 11 : 000B51B8 000B5154 000A5428 000A6424 **** REGS 12 - 15 : 000B5050 000B5438 000A5428 000A5428 **** INTERRUPT ADDRESS AT : 000A54AE **** RUN ERROR AT LOCATION : 00000086 OF PROCEDURE : FIBONACCI **** ERROR CODE IS 2004 : ADDRESSING EXCEPTION **** CODE AROUND ERROR PSW : A13C502D 007492C1 2000482D **** CALL STACK: CALLED ENTRY CALLER CALLOFFS FIBONACCI (000A5428) CALLED BY FIBONACCI (000000D8) FIBONACCI (000A5428) CALLED BY FIBONACCI (000000D8) FIBONACCI (000A5428) CALLED BY FIBONACCI (000000D8) FIBONACCI (000A5428) CALLED BY FIBONACCI (000000D8) FIBONACCI (000A5428) CALLED BY FIBONACCI (000000D8) FIBONACCI (000A5428) CALLED BY $PASMAIN (00000130) $PASMAIN (000A5598) CALLED BY Pascal Monitor **** ENTRY POINT $PASENT AT : 000A57B0 **** BOTTOM OF RUNTIME STACK : 000B5050 **** CURRENT STACK FRAME : 000B5438 **** CURRENT HEAP POINTER : 00493F78 **** POINTER TO TOP OF HEAP : 00493F78

look at the CALL STACK, which is new, and CODE AROUND ERROR PSW, which shows the machine instruction, which is the cause of the abend.

2.) Runtime check: SUBRANGE error


**** INTERRUPT ADDRESS AT : 000A5524 **** RUN ERROR AT LOCATION : 000000D4 OF PROCEDURE : FIBONACCI **** ERROR CODE IS 1002 : SUBRANGE VALUE OUT OF RANGE **** THE OFFENDING VALUE : -1 IS NOT IN THE RANGE : 0 30 **** CALL STACK: CALLED ENTRY CALLER CALLOFFS FIBONACCI (000A5450) CALLED BY FIBONACCI (000000B8) FIBONACCI (000A5450) CALLED BY FIBONACCI (000000B8) FIBONACCI (000A5450) CALLED BY FIBONACCI (000000B8) FIBONACCI (000A5450) CALLED BY FIBONACCI (000000B8) FIBONACCI (000A5450) CALLED BY FIBONACCI (000000B8) FIBONACCI (000A5450) CALLED BY FIBONACCI (000000B8) FIBONACCI (000A5450) CALLED BY FIBONACCI (000000B8) FIBONACCI (000A5450) CALLED BY FIBONACCI (000000B8) FIBONACCI (000A5450) CALLED BY $PASMAIN (00000130) $PASMAIN (000A5598) CALLED BY Pascal Monitor **** ENTRY POINT $PASENT AT : 000A57B0 **** BOTTOM OF RUNTIME STACK : 000B5050 **** CURRENT STACK FRAME : 000B5578 **** CURRENT HEAP POINTER : 00493F78 **** POINTER TO TOP OF HEAP : 00493F78

3.) Stack / Heap collision, that is, the program runs out of memory (2000 KB in this case):


**** INTERRUPT ADDRESS AT : 000A53E8 **** RUN ERROR AT LOCATION : 00000000 OF PROCEDURE : FIBONACCI **** ERROR CODE IS 1006 : STACK/HEAP COLLISION **** CALL STACK: CALLED ENTRY CALLER CALLOFFS FIBONACCI (000A53E8) CALLED BY FIBONACCI (000000FA) FIBONACCI (000A53E8) CALLED BY FIBONACCI (000000FA) FIBONACCI (000A53E8) CALLED BY FIBONACCI (000000FA) FIBONACCI (000A53E8) CALLED BY FIBONACCI (000000FA) FIBONACCI (000A53E8) CALLED BY $PASMAIN (00000130) $PASMAIN (000A5598) CALLED BY Pascal Monitor **** ENTRY POINT $PASENT AT : 000A57B0 **** BOTTOM OF RUNTIME STACK : 000B5050 **** CURRENT STACK FRAME : 001EDBB8 **** CURRENT HEAP POINTER : 0020CB78 **** POINTER TO TOP OF HEAP : 002A8F78

the error occurs, when a new stack frame should be allocated. Because it is way too large, this kind of error occurs. See the values at the end of the dump, showing the limits of the areas. The stack grows upwards, the (classical) heap downwards.

There is another heap (since 2016), similar to the LE heap, which is accessable thru the new functions ALLOC and FREE; it lives outside of this "classical" heap and makes room for another 4 to 6 MB of storage, depending on address space size.

PASSNAP and PASSNAPC - language specific SNAP dumps

For the kind of error diagnosis shown above, there is no need for a DBGINFO file or member. But if you have one, you can link your module with PASSNAP (on MVS) or PASSNAPC (on CMS) and you will get still better error diagnosis. Source line numbers are shown, and all variables will be printed in Pascal notation with the true Pascal variable names.

See these examples:

SNAPSHOT-Example (no program error)
PASSNAP output following S0C4 error
Same S0C4, but no PASSNAP due to NOSNAP option (PASMONN error handling)
Same S0C4, but SYSUDUMP due to NOSPIE option
PASSNAP output following Subrange error

Back to Compiler main page