[mod.computers.vax] Yet another VMS bug

carl@CITHEX.CALTECH.EDU.UUCP (03/24/87)

The following procedure demonstrates a bug in DIFF.EXE as it  exists  under  VMS
V4.5.   A class of files that cause this bug to manifest itself can be described
as follows:  One file has one more record than the other file.  All  records  in
the  second file differ from those in the first.  When DIFF is involked with the
/MAXIMUM_DIFFERENCES qualifier given a value equal to the number  of  records in
the  file  with  fewer, DIFF goes into an infinite (I think; I haven't outwaited
the loop yet, though, and the only way it's likely to exit from the loop  is  if
some sort of internal stack overflows or it hits some resource limit) loop.
********************************************************************************
$ create/fdl=sys$input: diff.dat	!create a file with known attributes
RECORD					!specify record attributes
      	FORMAT	VARIABLE		!variable length records
	SIZE	0			!no maximum record size
$ open/append file diff.dat		!now we populate it
$ write file "$"			!write an arbitrary record
$ write file "-"			!write an arbitrary record
$ close file				!we're done with this file
$ create/fdl=sys$input: diff.dat	!create a file with known attributes
RECORD					!specify record attributes
	FORMAT	VARIABLE		!variable length records
	SIZE	0			!no maximum record size
$ open/append file diff.dat		!now we populate it
$ write file "!"			!this record's different from the others
$ close file				!we're done with this file
$ on control_y then delete diff.dat;*	!prepare to do the cleanup when the user
$ diff/max=1 diff.dat			!control-y's out of the infinite loop
********************************************************************************
Has anybody else run into/reported this bug (or better yet, fixed it)?