XSUM_hashStream exits on file read errors, breaks multiple input processing #1064

Closed
opened 2025-08-26 15:56:26 -05:00 by ZoomRmc · 2 comments
ZoomRmc commented 2025-08-26 15:56:26 -05:00 (Migrated from github.com)

github.com/Cyan4973/xxHash@bab7e27f4c/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.

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.
Cyan4973 commented 2025-08-26 16:02:02 -05:00 (Migrated from github.com)

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.

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.
ZoomRmc commented 2025-08-26 16:11:14 -05:00 (Migrated from github.com)

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

Sure. If fixing this is not planned, the docs should mention that outputting any result for every input file is not guaranteed.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Cyan4973/xxHash#1064
No description provided.