Opened 5 years ago

Closed 5 years ago

#229 closed defect (fixed)

test_cpu test number 51 (sreg_no_write.alm) faults while loading an unset pointer

Reported by: Gary Dixon Owned by: Eric Swenson
Priority: major Milestone: MR12.8
Component: Documentation Version:
Keywords: Cc:

Description

test_cpu.pl1 invokes external subroutines to perform specific CPU tests on specific CPUs. One of those tests (test 51: sreg_no_write) can fail with the following symptoms:

Test 51   <sreg_no_write>
test_cpu: Test sreg_no_write encountered an unexpected fault_tag_1.
                              *** HARDWARE FAILING ***
          The function under test does not normally exhibit this failure.

MACHINE CONDITIONS AT 234|6600:

fault_tag_1 by sreg_no_write$|1774
(>system_library_tools>bound_cpu_tests_|105004)
referencing stack_4|40040 (in process dir)
Ascii data where pointer expected.
  Cannot get line number in sreg_no_write
105004   600024351520     epp1    pr6|24,*

Machine registers at time of fault

pr0 (ap)  234|4376            stack_4|4376
pr1 (ab)  234|6720            stack_4|6720
pr2 (bp)  234|6400            stack_4|6400
pr3 (bb)  234|6440            stack_4|6440  ( -> "tempseg_1               ")
pr4 (lp)  247|24204           !BBBKQGCLpbbKFd.area.linker|24204  (internal static|0 for ci_mod_case_2)
pr5 (lb)  247|24204           !BBBKQGCLpbbKFd.area.linker|24204  (internal static|0 for ci_mod_case_2)
pr6 (sp)  234|6320            stack_4|6320
pr7 (sb)  234|0               stack_4|0

x0  37324   x1   4376   x2   3320   x3   3164
x4      0   x5   3357   x6     10   x7      1
a 000404000004  q 107006000000  e 0
Timer reg - 117701, Ring alarm reg - 0

SCU Data:

  6630    400404250011 000000000007 400234000000 000000000000
          105004102200 040040000000 040040351440 200036251500

Fault Tag 1 Fault ( 7)
By: 404|105004 sreg_no_write|1774  (bound_cpu_tests_|105004)
Referencing: 234|40040 stack_4|40040  ( -> "                                                     ")
On: cpu a (#0)
Indicators:  cary, tro, ^bar
APU Status:  xsf, sd-on, pt-on, fabs
Instructions:
  6636    040040 3514 40      epp1      40040,f
  6637   2 00036 2515 00      spri1     pr2|36

Time stored: 07/21/21  1403.8 pdt Wed (154100507643061131)
Ring:          4

EIS Pointers and Lengths:

  6650    000400000101 000000000000 000000000000 000000000000
          000000000000 000000000000 000000000000 000000000000

CPU HISTORY REGISTERS AT TIME OF FAULT
DPS8 History Register Analysis

HR           IC or            c   Memory
id   Seg# [tpr.ca] opcode tag y  Address mc flags

CU                   scpr  n* ?   236204  0 inh its
CU                         n* ?   236204  0 inh its
CU                         n* ?   236260  0 inh its
CU                  cmpx3  du d        0  0 inh
CU                    tze     *        0  0 inh
CU                   eax3  x3 ?        3  0 inh
CU                    xec     ?   127155  0 inh its
CU                   scpr  n* ?   236204  0 inh its
CU                         n* ?   236204  0 inh its
CU                         n* ?   236204  0 inh its
CU                         n* ?   236260  0 inh its
CU                  cmpx3  du d        0  0 inh
CU                    tze     *        0  0 inh
CU                   eax3  x3 ?        3  0 inh
CU                    xec     ?   127155  0 inh its
CU                   scpr  n* ?   236204  0 inh its

This failure occurs in the test routine's module: sreg_no_write.alm.

Change History (4)

comment:1 by Eric Swenson, 5 years ago

The error in sreg_no_write.alm occurs here:

    001774  aa  6 00024 3515 20     24            epp1      pr6|20,*  return ptr
    001775  aa  2 00036 2515 00     25            spri1     pr2|30    save return ptr in new frame

The push operator at the beginning of the program has pushed a stack frame, but has not initialized the value of pr6|20 (the return pointer). The value at this location in the stack, therefore will have whatever value was left on the stack at this location by previous calls. When the instruction at 1774 attempts to load the return_ptr into the pr1 register, it may well fault (with a FT1) if the value is not a valid ITS pointer.

The instructions referenced above are not necessary for this program to perform correctly. There is a bunch of commented out code after the critical sreg instruction, whose behavior is under test here. Since the above instructions are not needed, they can be replaced with NOP instructions. A comment in the source indicates that the sreg instruction must be 2 words from the end of a page boundary (to test the issue it was designed for), and thus, we must replace the two instructions with NOPs, rather than deleting them. Alternatively, we could adjust the value of the ORG macro (which places the code at the appropriate offset) to ensure that the sreg instruction falls at the same place.

Last edited 5 years ago by Eric Swenson (previous) (diff)

comment:2 by Eric Swenson, 5 years ago

The following fixes the issue:

Segments found by read request:

  Build_script:            cpu_tests.mb;

  bound_cpu_tests_.s.archive:
    source:                sreg_no_write.alm                 IN: tools.source  REPLACE compiler: alm;

mbuild:  cmp

----------  sreg_no_write.alm

compare_ascii >ldd>tools>source>bound_cpu_tests_.s.archive::sreg_no_write.alm ==

A24                 epp1      pr6|20,*  return ptr
A25                 spri1     pr2|30    save return ptr in new frame
Changed by B to:
B24       "         epp1      pr6|20,*  return ptr
B25       "         spri1     pr2|30    save return ptr in new frame
B26                 nop
B27                 nop

Comparison finished: 1 difference, 6 lines.

mbuild:

comment:4 by Eric Swenson, 5 years ago

Milestone: MR12.8
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.