Opened 4 years ago

Closed 3 years ago

#293 closed defect (fixed)

unpaged_page_tables.incl.pl1 has an invalid declaration of the upt header.

Reported by: Gary Dixon Owned by: Gary Dixon
Priority: minor Milestone: MR12.8
Component: Hardcore Version: MR12.7
Keywords: Cc:

Description

The unpaged_page_tables.incl.pl1 segment includes a declaration that is not valid PL/I.

dcl  upt_ptr                          ptr;
dcl  1 upt                            aligned based (upt_ptr),
       2 sst_absloc                   fixed bin (26),       /* for dump analyzers */
       2 sst_last_loc                 fixed bin (26),
       2 upt_absloc                   fixed bin (26),
       2 upt_last_loc                 fixed bin (26),
       2 iupt_absloc                  fixed bin (26),
       2 iupt_last_loc                fixed bin (26),

       2 current_length               fixed bin,            /* number of words currently used */
       2 max_length                   fixed bin,            /* max number of words in memory allocated */
       2 first_entry                  like upt_entry;

dcl  upt_entry_ptr                    ptr;
dcl  1 upt_entry                      aligned based (upt_entry_ptr),
       2 size                         fixed bin,            /* number of page table words allocated */
       2 segno                        fixed bin,            /* of hardcore segment */
       2 ptws                         (0 refer (upt_entry.size)) bit (36) aligned;

The declaration of upt.first_entry is invalid because it is declared “like upt_entry”, but that structure is declared with refer extents.

AG94 page 5-5 states:

The only <attribute>s copied by the expansion of the <like attribute> are those
<attribute>s that were explicitly specified in the declaration of the members of
the structure identified by the <like reference>. No inherited <dimension
attribute>, <aligned attribute> or <unaligned attribute> is copied. Since
expansion occurs before <attribute>s are supplied by default, <attribute>s
supplied by default are not copied.

Because dimension attributes are not copied, the array dimension of upt_entry.ptws is not copied, but the fact that it is an array is copied. The ramification is that the azm request “d unpaged_page_tables -as upt” loops indefinitely attempting to display the upt.ptws(*) array.

azm:  d unpaged_page_tables -as upt
upt                           @ 12|0
  sst_absloc = 3960832, sst_last_loc = 4127743, upt_absloc = 21504, upt_last_loc = 22527, iupt_absloc = 0, iupt_last_loc = 0,
  current_length = 496, max_length = 1024
  first_entry                 @ 12|10
    size = 1, segno = 1, ptws (1) = "000100421125"b3, ptws (2) = "000000011003"b3, ptws (3) = "000000000001"b3,
    ptws (4) = "000000000005"b3, ptws (5) = "000240421125"b3, ptws (6) = "000000011003"b3, ptws (7) = "000000000002"b3,
    ptws (8) = "000000000010"b3, ptws (9) = "000460421125"b3, ptws (10) = "000500421125"b3, ptws (11) = "000000000001"b3,
    ptws (12) = "000000000012"b3, ptws (13) = "000520421125"b3, ptws (14) = "000000011003"b3, ptws (15) = "000000000002"b3,
    ptws (16) = "000000000013"b3, ptws (17) = "000240421125"b3, ptws (18) = "000260420025"b3, ptws (19) = "000000000001"b3,
        . . .

The only way out of this azm loop is to quit (telnet “send break”) and then program_interrupt back into azm request loop.

I also believe that the <like attribute> cannot include a declaration with a <refer option> because the name of the variable referenced in the <refer option> is not properly qualified when copied into the structure declared using the <like attribute>. But I can’t find that restriction stated clearly in AG94.

The fix would involve repeating the substructure in upt_entry as lines in upt.first_entry, with the refer clause changed to (0 refer (upt.first_entry.size)). That way, the display of upt would stop after displaying the first upt_entry’s worth of data.

Only structure_library_5_.cds would have to be recompiled to implement the bug fix. None of the other code using this include file has encountered a problem with the current declaration.

Change History (6)

comment:1 by Gary Dixon, 4 years ago

Owner: changed from Eric Swenson to Gary Dixon
Status: newaccepted

comment:2 by Gary Dixon, 4 years ago

Priority: majorminor
Resolution: wontfix
Status: acceptedclosed

My proposed fix does not resolve the problem. I am therefore stopping work on the issue. I don't know how to correct the problem.

comment:3 by Gary Dixon, 4 years ago

Resolution: wontfix
Status: closedreopened

The loop in the azm request: display unpaged_page_tables -as upt can be successfully avoided by changed the declaration of the upt.first_entry element.

A23              2 first_entry                  like upt_entry;
Changed by B to:
B32              2 first_entry                  fixed bin;            /* size of the 1st page table (see: upt_entry.size below) */

That will prevent azm from trying to display the first page table when showing the upt structure (header for the unpaged_page_tables segment). This change can be safely done because none of the programs that reference unpaged_page_tables.incl.pl1 make any reference to upt.first_entry (or any of its elements).

I am therefore reopening this ticket.

comment:4 by Gary Dixon, 4 years ago

Status: reopenedaccepted

comment:6 by Eric Swenson, 3 years ago

Milestone: MR12.8
Resolution: fixed
Status: acceptedclosed
Version: MR12.7

Fixed in MR12.8-1054

Note: See TracTickets for help on using tickets.