Re: Weird cpio bug
Thank you for your report. What you were seeing was the percolation of a
random bogus value taken as an error code through several layers, all due
to a bug having to do with zero-length writes. cpio gives you the error
because it does a `write' call with zero length, and expects it to work,
and rightly so. That call does not in fact work as it should.
This uncovered two bugs. The first bug was in libpager::pager_memcpy,
which just plain doesn't handle zero-length transfers and returns a
completely bogus value, resulting in what you saw. The second bug was in
libdiskfs::_diskfs_rdwr_internal, where for wholly unrelated reasons, it
should not have called pager_memcpy with a zero length so as to elicit the
first bug in the first place. (The unrelated reason is that POSIX requires
that reads and writes of zero length not have any side effects on a file
like update the mtime or atime.)
I have just now checked in fixes for both of these bugs, and your cpio test
case now works fine. You'll need to update your hurd to get the fix.