kern/60089: UDF filesystem appends garbage to files

Gordon Burditt gordonb at
Tue Dec 9 13:00:42 PST 2003

>Number:         60089
>Category:       kern
>Synopsis:       UDF filesystem appends garbage to files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 09 13:00:38 PST 2003
>Originator:     Gordon Burditt
>Release:        FreeBSD 5.1-RELEASE i386
System: FreeBSD 4.9-STABLE FreeBSD 4.9-STABLE #7: Sat Nov 22 14:13:11 CST 2003 gordon at i386

	(Reporting this from a FreeBSD-4.9 system even though the
	DVD drive is installed on a 5.1-RELEASE system and the
	bug is observed on 5.1-RELEASE.  FreeBSD 4.9-RELEASE does
	not have mount_udf).


	mkisofs 2.0.3
	Generic Cheap DVD+/-R+/-RW recorder (reproducible without this)

	If you build a UDF filesystem image of compressed files 
	(using mkisofs), then mount it (either burning it to DVD and mounting
	it, or mounting the image with mdconfig/mount), different programs
	will see the file length differently (either correct, or apparently
	rounded up to the next 64k in size).  In my case I used compressed
	filesystem dumps.

	ls -l says the original var.dump.gz and the one in the UDF 
	filesystem are the same length.
	cmp says the files are identical (not EOF on one of the files).
	wc says the UDF filesystem file is longer.
		6909   40703 1900544 /mnt/book/var.dump.gz     (UDF filesystem)
		6905   40385 1863645 /backups/dumps/0/book/var.dump.gz
	gzip -tv says there is trailing garbage at the end of the UDF file, 
		but the checksum is OK.
	hd shows extra stuff at the end of the UDF file.
	md5 says that the checksums are different.

	Not all files have their sizes rounded up to the next 64k, in
	particular not small files.  Files with the observed problem
	range from 326KB to almost 396MB.  Files without the problem
	range from 109 bytes to 6.5KB.  As it happens, there were no files
	between 6.5KB and 326KB.  I do not know for sure that this
	is strictly a file size issue.

	Whether or not mkisofs is producing a corrupted UDF filesystem,
	it does seem strange that some programs see the file as one size
	and others see it as another size.

	Build a directory tree of large (e.g. 2MB to 400MB) gzipped files.
	Using mkisofs 2.0, build a UDF filesystem image from these files.
	Either (a) Use mdconfig and mount the image, or (b) burn the
	image to a CD-R/DVD-R and mount it.  Run gzip -tv on the
	gzipped files.  Note message about "decompression OK, trailing
	garbage ignored".  Verify that this message does not occur on
	the original files used to build the UDF filesystem image.

	not known.


						Gordon L. Burditt

More information about the freebsd-bugs mailing list