[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#721723: apt: FTBFS on non-Linux: Testing with HashSums_libapt_test ###FAILED###



David Kalnischkies <kalnischkies+debian@gmail.com> writes:

> "d41d8cd98f00b204e9800998ecf8427e" is the md5 of an empty file.
> "89f331147b07a354262948559d430f0b" is the md5 of our test file.
> So the code calculates the right md5, but the expectation is wrong.

AFAICT, the d41... value comes from a second pass through the file after
determining its length and seeking back to the start.  (Your equals
macro prints its arguments in reverse order on failure.)

It looks like the fseek may be ineffective because the code in question
mixes file descriptors and FILE pointers, which might be implemented in
a manner (using mmap?) that wouldn't guarantee identical offsets even
when not pulling anything into their buffers.  I'd suggest reworking it
to use plain file descriptors throughout.

-- 
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
http://www.mit.edu/~amu/ | http://stuff.mit.edu/cgi/finger/?amu@monk.mit.edu


Reply to: