x86-64 Pascal problem

User avatar

Topic author
arne_v
Master
Posts: 409
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Offline
Contact:

x86-64 Pascal problem

Post by arne_v » Wed Feb 07, 2024 11:56 am

I did not expect this:

Code: Select all

$ type z5.pas
program z5(input, output);

type
   pstr = varying [1812] of char;

procedure test1(xmlstr : pstr);

begin
    writeln(xmlstr);
end;

begin
    writeln('start');
    test1('<methodResponse>' +
          '<params>' +
          '<param>' +
          '<value><i4>123</i4></value>' +
          '</param>' +
          '</params>' +
          '</methodResponse>');
end.
$ pas z5
$ link z5
$ r z5
start
<methodResponse><params><param><value><i4>123</i4></value></param></params></methodResponse>
$ type z6.pas
program z6(input, output);

type
   pstr = varying [1813] of char;

procedure test1(xmlstr : pstr);

begin
    writeln(xmlstr);
end;

begin
    writeln('start');
    test1('<methodResponse>' +
          '<params>' +
          '<param>' +
          '<value><i4>123</i4></value>' +
          '</param>' +
          '</params>' +
          '</methodResponse>');
end.
$ pas z6
$ link z6
$ r z6
start
%SYSTEM-F-ACCVIO, access violation, reason mask=05, virtual address=000000007ACDA000, PC=FFFF830009A4B279, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
image     module    routine               line      rel PC           abs PC
LIBOTS                                       0 0000000080002279 FFFF830009A4B279
z6  Z6  TEST1                                6 000000000000008F 000000008000008F
z6  Z6  Z6                                  14 000000000000005B 000000008000005B
                                             0 FFFF8300081FC0A6 FFFF8300081FC0A6
DCL                                          0 00000000800677FB 000000007ADFF7FB
%TRACE-I-END, end of TRACE stack dump
What happen when the varying goes from 1812 to 1813??

Added in 46 minutes 9 seconds:
And:

$ pas/ver
VSI Pascal x86-64 V6.3-143 (GEM 50XC4) on OpenVMS x86_64 V9.2-2

Added in 22 minutes 6 seconds:
In the real program I got other errors with 1800. But it worked with 800. So the 1812-1813 difference seems to depend on the specific context.

Not sure how useful this note is, but ...

Added in 17 minutes 41 seconds:
And the real program works fine on Alpha with 32000.
Arne
arne@vajhoej.dk
VMS user since 1986


rodprince
Contributor
Posts: 21
Joined: Mon Aug 14, 2023 6:00 pm
Reputation: 0
Status: Offline

Re: x86-64 Pascal problem

Post by rodprince » Thu May 30, 2024 3:22 pm

Just installed the pascal x86vms-pascal-x0604-144-1.zip and I can see the "invalid tag" output as well.

Code will compile with out any "invalid tag" output if I do not include the /debug switch on the compile line. Essentially something from the /debug "stuff" is causing it. Will attempt to strip down a piece of code and see if I can determine what data structure is causing it

Rod

I found what was causing one of the many "Invalid tags" to pop out of the $pascal/debug. Stripped a program down until, one of the "invalid tags" went away. The code that causes the "invalid tag" is as follows (please note, was simplified and all names/values were essentially removed to make the "IP" guys happy):

Code: Select all

Module xyz;

const
  tt_type_0 = 0;
  tt_type_1 = 1;
  tt_type_2 = 2;
  tt_type_3 = 3;

  tt_type_low  = tt_type_0;
  tt_type_high = tt_type_3;

type
  tt_type_category  = tt_type_low .. tt_type_high;
  tt_type_set       = set of tt_type_category;

var
  xyz : array[ 1..9 ] of tt_type_set
      := ( (* 1 *) [ tt_type_1, tt_type_2],
           (* 2 *) [ tt_type_0, tt_type_1 ],
           (* 3 *) [ ],
           (* 4 *) [ ],
           (* 5 *) [ ],
           (* 6 *) [ ],
           (* 7 *) [ ],
           (* 8 *) [ ],
           (* 9 *) [ ]
         );
end.

$pas/debug/nopt output is
invalid tag
!4 = !DICompositeType(tag: DW_TAG_set_type, baseType: !5, size: 32, align: 32)
Last edited by rodprince on Thu May 30, 2024 3:59 pm, edited 3 times in total.

User avatar

Topic author
arne_v
Master
Posts: 409
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Offline
Contact:

Re: x86-64 Pascal problem

Post by arne_v » Thu May 30, 2024 7:15 pm

V6.3 -> X6.4 also solved my problem.
Arne
arne@vajhoej.dk
VMS user since 1986


jreagan
VSI Expert
Master
Posts: 154
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: x86-64 Pascal problem

Post by jreagan » Wed Jun 05, 2024 12:17 pm

RE: "invalid tag". Yeah, we added support in the frontend for better debug support for SETs. The version of the backend I used didn't have the matching support. I thought I had grabbed the newer copy. The message is just about debug information and can be ignored. You won't have SET debugging but you didn't have it before.

Post Reply