[Info-vax] QIO Writes to a mailbox

Johnny Billquist bqt at softjar.se
Fri Nov 4 19:01:29 EDT 2011


On 2011-11-04 20.27, Michael Moroney wrote:
> Steve Bainbridge<stephen_bainbridge at yahoo.co.uk>  writes:
>
>> This code was written several years ago and I've been dumped on to
>> investigate and correct the issue we now very occasionally see. I'm
>> aware of the obvious missing check on the IOSB, but I can't say with
>> any certainty that this is causing the problem.
>
> You *must* check the IOSB status and make sure the operation is complete
> to ensure the operation was performed properly.  Especially when using
> QIO (no W).

No matter if it is QIO or QIOW. IOSB is equally relevant in both cases. 
That is the only place where the actual result of the I/O can be found.

>> Whilst it's simple to change the code, replicating the problem has
>> proved impossible and releasing into production onto many tens of
>> systems takes a long time with a lot of effort - especially when we
>> don't know if the problem has been resolved. So we would prefer to try
>> and understand why we are seeing the problem, rather than just
>> incrementally trying to correct issues.
>
> Not checking the status is almost certainly the cause of the problem.

I don't think so, but it could be. Modifying the buffer before the I/O 
is complete can equally well be the problem, if the program actually 
might do that.

Either way, the proper sequence of operation is:

Issue QIO(W)
Check R0 (or return code) for system call success.
Wait for operation to complete
Check IOSB to see the actual result of the I/O operation

Obviously, if the system call fails, there is no I/O to wait for, or check.

	Johnny



More information about the Info-vax mailing list