edit/sum (sumslp) crash for stream-lf input file

Share your experience porting VMS applications to x86 here.

Topic author
malmberg
Contributor
Posts: 11
Joined: Tue Apr 16, 2024 7:55 pm
Reputation: 0
Status: Offline

edit/sum (sumslp) crash for stream-lf input file

Post by malmberg » Wed Jan 08, 2025 9:30 am

This showed up as part of the unit tests validating the port of the gawk package of OpenVMS.

Demonstration script:

Code: Select all

$! sum_streamlf_test.com

$create stream_lf.txt
$set file stream_lf.txt /attr=(rfm:stmlf,lrl:32767,mrs:0,rat:cr)
$open/write slf stream_lf.txt
$write slf "line 1"
$write slf "line 2"
$write slf "line 3"
$close slf

edit/sum stream_lf.txt /update=sys$input: /output=stream_lf.out
-1,2
/
$ diff stream_lf.txt stream_lf.out
Running Script:

Code: Select all

ROBIN> set ver
ROBIN> @sum_streamlf_test.com
$! sum_streamlf_test.com

$create stream_lf.txt
$set file stream_lf.txt /attr=(rfm:stmlf,lrl:32767,mrs:0,rat:cr)
$open/write slf stream_lf.txt
$write slf "line 1"
$write slf "line 2"
$write slf "line 3"
$close slf

edit/sum stream_lf.txt /update=sys$input: /output=stream_lf.out
%SYSTEM-F-ACCVIO, access violation, reason mask=05, virtual address=FFFFFFFF8000
6695, PC=FFFF830007C0DD1A, PS=0000001B

  Improperly handled condition, image exit forced.
    Signal arguments:   Number = 0000000000000005
                        Name   = 000000000000000C
                                 0000000000000005
                                 FFFFFFFF80006695
                                 FFFF830007C0DD1A
                                 000000000000001B
    Register dump:
    RAX = FFFFFFFF80006695  RDI = FFFFFFFF80006695  RSI = 0000000000000005
    RDX = 000000000000002E  RCX = 0000000000000000  R8  = 000000007AC9F3A0
    R9  = 0000000000000000  RBX = 000000007AC9FF58  RBP = 000000007AC9F390
    R10 = 0000000000000010  R11 = 0000000000000206  R12 = 000000007AC9F598
    R13 = 0000000000000000  R14 = 000000007FFCDA98  R15 = 000000012B274603
    RIP = FFFF830007C0DD1A  RSP = 000000007AC9F368  SS  = 000000000000001B
%DCL-W-SKPDAT, image data (records not beginning with "$") ignored

User avatar

arne_v
Senior Member
Posts: 621
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Offline
Contact:

Re: edit/sum (sumslp) crash for stream-lf input file

Post by arne_v » Wed Jan 08, 2025 9:36 am

What VMS version(s) have the problem and which do not?
Arne
arne@vajhoej.dk
VMS user since 1986


Topic author
malmberg
Contributor
Posts: 11
Joined: Tue Apr 16, 2024 7:55 pm
Reputation: 0
Status: Offline

Re: edit/sum (sumslp) crash for stream-lf input file

Post by malmberg » Wed Jan 08, 2025 7:26 pm

Seen on OpenVMS 9.2-2 x86_64 community edition.

Not seen on my AXP or IA64 systems that are still at an 8.4 version.

User avatar

arne_v
Senior Member
Posts: 621
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Offline
Contact:

Re: edit/sum (sumslp) crash for stream-lf input file

Post by arne_v » Wed Jan 08, 2025 7:39 pm

Hmm.

On VMS x86-64 9.2-3 I see:
$! sum_streamlf_test.com
$create stream_lf.txt
$set file stream_lf.txt /attr=(rfm:stmlf,lrl:32767,mrs:0,rat:cr)
$open/write slf stream_lf.txt
$write slf "line 1"
$write slf "line 2"
$write slf "line 3"
$close slf
$ edit/sum stream_lf.txt /update=sys$input: /output=stream_lf.out
-1,2
/
-1,2
-1,2
/
$ diff stream_lf.txt stream_lf.out
************
File DKA0:[arne]stream_lf.txt;3
1 line 1
2 line 2
3 line 3
******
File DKA0:[arne]stream_lf.out;2
1 line 3
************

Number of difference sections found: 1
Number of difference records found: 2

DIFFERENCES /MERGED=1-
DKA0:[arne]stream_lf.txt;3-
DKA0:[arne]stream_lf.out;2
Added in 1 minute 20 seconds:
Which of course raise the question whether it is a 9.2-2 vs 9.2-3 difference. Or if it is a your system vs my system difference.

Anyone with 9.2-2 that can check if they can recreate?
Arne
arne@vajhoej.dk
VMS user since 1986

User avatar

m_detommaso
Master
Posts: 122
Joined: Thu Jun 06, 2019 6:57 am
Reputation: 1
Location: Brindisi (Italy)
Status: Offline
Contact:

Re: edit/sum (sumslp) crash for stream-lf input file

Post by m_detommaso » Thu Jan 09, 2025 6:16 am

Confirmed, the problem is easily replicated only on VMS x86 V9.2-2; with VMS x86 V9.2-3 everything works correctly

Code: Select all

system_rieman_opa0 >product sho product vms/full
------------------------------------ ----------- --------- ------------------------------------ ------------------------------------
PRODUCT                              KIT TYPE    STATE     MAINTENANCE                          REFERENCED BY
------------------------------------ ----------- --------- ------------------------------------ ------------------------------------
VSI X86VMS VMS V9.2-2                Oper System Installed VSI X86VMS VMS922X_DEBUG V2.0        VSI X86VMS DWMOTIF V1.8
                                                           VSI X86VMS VMS922X_DEBUG V1.0        VSI X86VMS KERBEROS V3.3-2A
                                                           VSI X86VMS VMS922X_PCSI V1.0         VSI X86VMS OPENVMS V9.2-2
                                                           VSI X86VMS VMS922X_UPDATE V2.0       VSI X86VMS TCPIP V6.0-26
                                                           VSI X86VMS VMS922X_UPDATE V1.0
------------------------------------ ----------- --------- ------------------------------------ ------------------------------------
1 item found

system_rieman_opa0 >type sum_streamlf_test.com
$! SUM_STREAMLF_TEST.COM
$! https://forum.vmssoftware.com/viewtopic.php?f=42&t=9342&sid=7fbda86652c3ce0ebb51f61223031942
$!
$ create stream_lf.txt
$ set file stream_lf.txt /attr=(rfm:stmlf,lrl:32767,mrs:0,rat:cr)
$ open/write slf stream_lf.txt
$ write slf "line 1"
$ write slf "line 2"
$ write slf "line 3"
$ close slf
$ exit

system_rieman_opa0 >@sum_streamlf_test
system_rieman_opa0 >dir

Directory DISK$RIEMAN_DUMP:[dcl_procedures.malmberg_edit_issue]

stream_lf.txt;2     stream_lf.txt;1     sum_streamlf_test.com;1

Total of 3 files.
system_rieman_opa0 >edit/sum stream_lf.txt /update=sys$input: /output=stream_lf.out
%SYSTEM-F-ACCVIO, access violation, reason mask=05, virtual address=FFFFFFFF80006695, PC=FFFF83000780DD1A, PS=0000001B

  Improperly handled condition, image exit forced.
    Signal arguments:   Number = 0000000000000005
                        Name   = 000000000000000C
                                 0000000000000005
                                 FFFFFFFF80006695
                                 FFFF83000780DD1A
                                 000000000000001B
    Register dump:
    RAX = FFFFFFFF80006695  RDI = FFFFFFFF80006695  RSI = 0000000000000005
    RDX = 000000000000002E  RCX = 0000000000000000  R8  = 000000007AB493A0
    R9  = 0000000000000000  RBX = 000000007AB49F58  RBP = 000000007AB49390
    R10 = 0000000000000010  R11 = 0000000000000206  R12 = 000000007AB49598
    R13 = 0000000000000000  R14 = 000000007FFCDA98  R15 = 000000003D974603
    RIP = FFFF83000780DD1A  RSP = 000000007AB49368  SS  = 000000000000001B

Since vms x86 V9.2-2 is listed as being in standard support until December 31, 2027, this issue should be resolved by VSI engineering.

https://vmssoftware.com/about/roadmap/

malmberg_edit.PNG
Last edited by m_detommaso on Thu Jan 09, 2025 6:38 am, edited 1 time in total.


amuir
Member
Posts: 9
Joined: Thu Feb 29, 2024 1:40 pm
Reputation: 0
Status: Offline

Re: edit/sum (sumslp) crash for stream-lf input file

Post by amuir » Thu Jan 09, 2025 6:23 am

arne_v wrote:
Wed Jan 08, 2025 7:40 pm
Which of course raise the question whether it is a 9.2-2 vs 9.2-3 difference. Or if it is a your system vs my system difference.

Anyone with 9.2-2 that can check if they can recreate?
Well, I can confirm the issue occurs on my on 9.2-1 system, but not on my 9.2-3 system. So, I think that rules out the "his system" possibility, and strongly suggests that the issue was fixed in 9.2-3.

User avatar

arne_v
Senior Member
Posts: 621
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Offline
Contact:

Re: edit/sum (sumslp) crash for stream-lf input file

Post by arne_v » Thu Jan 09, 2025 2:46 pm

I believe there are a lot of good fixes in the 9.2-2 -> 9.2-3 upgrade.

If possible then I will suggest going 9.2-3.
Arne
arne@vajhoej.dk
VMS user since 1986


dgordon
VSI Expert
Valued Contributor
Posts: 70
Joined: Tue May 09, 2023 7:57 am
Reputation: 1
Status: Offline

Re: edit/sum (sumslp) crash for stream-lf input file

Post by dgordon » Thu Jan 09, 2025 9:52 pm

EDIT/SUM was fixed for V9.2-3. The code has static data addresses in a PSECT marked EXE. This was not a problem on previous architectures, but can be on x86. I suspect that if you test it on prior versions, EDIT/SUM with any file type will crash with an ACCVIO.

You should be able to pull SYS$SYSTEM:SUMSLP.EXE from any V9.2-3 system and use it on previous versions. If you really need a fix for earlier versions, you'll have to go through support if that's an option for you.
Executive Vice President of InfoServer Engineering at VSI.


hein
Valued Contributor
Posts: 54
Joined: Fri Dec 25, 2020 5:20 pm
Reputation: 0
Status: Offline

Re: edit/sum (sumslp) crash for stream-lf input file

Post by hein » Mon Jan 13, 2025 11:09 am

Code: Select all

$! sum_streamlf_test.com
$create stream_lf.txt
$set file stream_lf.txt /attr=(rfm:stmlf,lrl:32767,mrs:0,rat:cr)
$open/write slf stream_lf.txt
This is NOT a STREAM_LF thing if the above is the actual reproducer.
I'm not arguing whether there is an issue with EDIT/SUM.
However, the test file as created below is a regular DCL: VFC, 2 byte header, maximum 0 bytes

Two things are incorrect.

1 - Using SET FILE as shown only works on EMPTY file, which was the case here, but do not get lured into believing that's the right way to change a file from standard VAR to STREAM_LF. Any existing record in there will create a mess.

2 - The OPEN/WRITE will create a fresh standard DCL file. You need OPEN/WRITE/APPEND to use an existing file.

To create a STREAM_LF file I recommend:

Code: Select all

$create/fdl="record; format stream_lf; size 32767" stream_lf.txt
To make an existing file STREAM_LF I recommend:

Code: Select all

$convert/stat/fdl="record; format stream_lf; size 32767" x.txt stream_lf.txt
fwiw,
Hein.




'


hb
Master
Posts: 163
Joined: Mon May 01, 2023 12:11 pm
Reputation: 0
Status: Offline

Re: edit/sum (sumslp) crash for stream-lf input file

Post by hb » Mon Jan 13, 2025 12:53 pm

hein wrote:
Mon Jan 13, 2025 11:09 am
... if the above is the actual reproducer.
It seems, it is a reproducer for a problem in EDIT/SUM, which is fixed in V9.2-3. The problem as seen on older versions of VMS on x86 seems independent of the record format. The initial report on this is hidden in the blog, referenced in https://forum.vmssoftware.com/viewtopic ... 138#p23138. It was said, that the file was created by "gawk". It seems creating this "reproducer" was easier than showing/extracting the actual commands with "gawk" - which, as far as I know, is not yet available on x86.

Anyone who reproduced the problem or confirmed the fix, probably noticed the difference. :-) If you create and modify the empty file as show, then a "gawk" redirection the output with ">stream_lf.txt" will create a new version of the file with stream_lf. Same if you use "define/user sys$output" to point to this file - and "gawk" without output redirection. (This may have been the original usage, the thread creator probably knows.) But a "define sys$output" and running "gawk" will create a file with vfc. At least that's what I see on Alpha. Confusing?

I assume someone who can change the title of this thread will adjust it.

Post Reply