﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
195	tape_mult_ doesn't set nread to zero when returning error_table_$end_of_info	dmw.technical@…	Gary Dixon	"This issue was described on dps8m-users on Dec 6, 2019.

The following program elicits and diagnoses the error. See comments for instructions:
&version 2
&trace &all_types off

&-      tryit28.ec -- an exec_com program to demonstrate a
&- problem w/ tape_mult_.  The problem is that the get_chars
&- entry does not set the status code to zero once an end of
&- file has been detected (191208)

&- To run this test program:
&-      1) Create an MST tape, however it might be convenient.  The
&-         tape should be reasonably short, less than 500k bytes.
&-      2) Edit this program so that TAPELABEL is set to the label
&-         name of the MST tape.
&-      3) Run this program.  If it detects the relevant error, it
&-         will signal INVALID_RETURN_VALUE_FROM_IOX_GET_CHARS (or
&-         actually, the first 32 chars of that name).  Otherwise,
&-         is should complete without complaint.

&set TAPELABEL ""tmp/CARRY""

&on cleanup
&begin
&-      &print In cleanup handler. Doing non-local &&goto.
        &if &[io_call attached S]
        &then &do
                &if &[io_call opened S]
                &then   io_call close S
                io_call detach S
        &end
        io_call close S
        io_call detach S
&end

&- &trace &all
&if &[io_call attached S]
&then &do
        &if &[io_call opened S]
        &then   io_call close S
        io_call detach S
io_call attach S tape_mult_ &(TAPELABEL)
io_call open S stream_input
io_call get_chars S 800000 -segment &[pd]>foo 0
                &- That should have positioned the tape at EOF (for
                &- any tape w/ less than 800 KiB.

&print &[io_call find_iocb S]
&set SIOCBPTR &[io_call find_iocb S]
&- &print &(SIOCBPTR)

                &- Verify that we've actually reached EOF.
&set errcode &[call iox_$get_chars -input &(SIOCBPTR) -input ""abc"" -addr ""char(1000)"" -input 1000 -input 9999 -output -code -return]
&print errcode = &(errcode)
&if &[not &[equal &(errcode) error_table_$end_of_info]]
&then   signal UNEXPECTED_STATUS_CODE_FROM_IOX_GET_CHARS

&set n_read &[call iox_$get_chars -input &(SIOCBPTR) -input ""abc"" -addr ""char(1000)"" -input 1000 -inout 9999 -return -input 0]
&print n_read = &(n_read)
&if &[not &[nequal &(n_read) 0]]
&then   signal INVALID_RETURN_VALUE_FROM_IOX_GET_CHARS

io_call close S
io_call detach S

&quit



&end



"	defect	closed	minor	MR12.7	Hardcore	MR12.6f	fixed	MST tape_mult_	
