[comp.os.vms] mysterious SMG-Error

oper@DHAFEU51.BITNET (08/06/87)

Hi netlanders,
sorry, if you have seen this before, but my first posting _seemed_ to
go wrong.

Devoloping a Pascal program, which consists of about 70 modules and which
uses Ingres database and SMG window-management functions, a mysterious error
appears. The program is written with the following system configuration:
   VAX\VMS              4.5
   Pascal compiler      3.5     using Compiler options: DEBUG/NOOPTIMIZE/LIST
   Linker               4.0        using Linker options: MAP/DEBUG/BRIEF
   Debugger             4.5.6
The error message looks like:

%SYSTEM-F-ACCVIO, access violation, reason mask=05, virtual address=7EFFFFA0,
PC=0001127C, PSL=03C00000

  Improperly handled condition, image exit forced

        Signal arguments              Stack contents

        Number = 00000005                6148000D
        Name   = 0000000C                70747075
                 00000005                72676F72
                 7EFFFFA0                056D6D61
                 0001127C                04000000
                 03C00000                6C000000
                                         327FF26D
                                         01000111
                                         C6000000
                                         007FF26C

        Register dump

        R0 = 00000000  R1 = 0001050D  R2 = 00000000  R3 = 7FF26CFC
        R4 = 00000000  R5 = 00000000  R6 = 7FF26CFC  R7 = 7FFED78A
        R8 = 7FFED052  R9 = 7FFED25A  R10= 7FFEDDD4  R11= 7FFE33DC
        AP = 7FF26CB1  FP = 7FF26C70  SP = 7FF26CED  PC = 0001127C
        PSL= 03C00000

The situation in the program according to the error is described in the
following figure:

       -----------------           ------------------------------------
       |               |           |                                  |
       |               |           |                                  |
       |               |           |                                  |
       | while ..      |           | procedure abc;                   |
       |  :            |           |  :                               |
       |  abc;         |           |  smg$paste_virtual_display (..)  |
       |  :            |           |  :                               |
       | end; (*while*)|           | end; (*proc*)                    |
       | end.          |           | end.                             |
       -----------------           ------------------------------------
         Module A                              Module B

Module A calls procedure abc of module B inside a while-loop. During the
first call of procedure abc no error appears and the program works as expected.
During the second call of procedure abc, every statement included in its
body is executed as expected, except one run-time library window-management
procedure, the smg$paste_virtual_display function call. This statement isn't
executed, but the procedure abc can be finished without any error message.
After executing the last statement of procedure abc correctly and before
starting the next statement of module A, the error message shown above
appears.

It's not possible to detect the error using the VMS Debugger, because
setting a breakpoint near the end of procedure abc and stepping ahead lets
the error disappear! No error message is given and the program can be
continued. It needn't be emphasized, that every declaration of the
smg-functions and the use of the Linker is faultless and according to the
conventions.

We would like to know the following:
Who has any experience with errors, perhaps caused by the Linker or the
smg-window-management-functions or something else, which disappear if the
debbuger is used to step over the statements, which are supposed to cause
the error?
Who can give us any hint to the reason of the error?

  thanks in advance
  OPER@DHAFEU51.bitnet
FernUniversitaet  Hagen
  -Informatikrechner-

"Philip_Young.XSISHQ"@XEROX.COM (08/06/87)

You write that
> It's not possible to detect the error using the VMS Debugger, because
> setting a breakpoint near the end of procedure abc and stepping
> ahead lets the error disappear.

 I've had similar problems with both Pascal and PL/I related to code
optimization. When you run under the debugger you see no problem since
you must compile with /NOOPT. The same is true if you compile with
/NOOPT/DEBUG and then $RUN/NODEBUG. Is this what is happening here?

Phil Young
Xerox Corp.