xxHash icon indicating copy to clipboard operation
xxHash copied to clipboard

XSUM_hashStream exits on file read errors, breaks multiple input processing

Open ZoomRmc opened this issue 4 months ago • 2 comments

https://github.com/Cyan4973/xxHash/blob/bab7e27f4c6ae4efbb83dd99ae8a554423571635/cli/xxhsum.c#L279-L281

XSUM_hashStream exits on ferror with the Error: a failure occurred reading the input file. message. This prevents processing multiple input files.

In my case, finding FS/device errors was exactly the point of running xxhsum. When processing files in batches and parsing the output, if the process exited prematurely, the whole batch was marked as failed which resulted in great number of false negatives.

ZoomRmc avatar Aug 26 '25 20:08 ZoomRmc

It requires updating XSUM_hashStream() so that it can return an error. Right now, it can only return successfully, and therefore it exit() when it can't.

Cyan4973 avatar Aug 26 '25 21:08 Cyan4973

Sure. If fixing this is not planned, the docs should mention that outputting any result for every input file is not guaranteed.

ZoomRmc avatar Aug 26 '25 21:08 ZoomRmc