markfasheh / duperemove

Tools for deduping file systems
GNU General Public License v2.0
832 stars 82 forks source link

find_dupes.c: print search status: pos == NaN #348

Open matthiaskrgr opened 3 months ago

matthiaskrgr commented 3 months ago

1) compiled with -Wall -O2 -fsanitize=address,undefined -fno-omit-frame-pointer -g3 -march=native -flto 2) UBSAN_OPTIONS=print_stacktrace=1 ./duperemove ../wesnoth -rdh --dedupe-options=partial

=>

Search completed with no errors.
Simple read and compare of file data found 0 instances of extents that might benefit from deduplication.
Nothing to dedupe.
Loading only identical files from hashfile.
Simple read and compare of file data found 0 instances of files that might benefit from deduplication.
Nothing to dedupe.
Loading only duplicated hashes from hashfile.
Found 0 identical extents.
Using 8 threads to search within extents for additional dedupe. This process will take some time, during which Duperemove can safely be ctrl-c'd.
find_dupes.c:65:8: runtime error: -nan is outside the range of representable values of type 'int'
    #0 0x583e8787fdaa in print_extent_search_status /home/matthias/vcs/github/duperemove/find_dupes.c:65:8
    #1 0x583e8787fdaa in wait_update_extent_search_status /home/matthias/vcs/github/duperemove/find_dupes.c:115:2
    #2 0x583e8787fdaa in find_additional_dedupe /home/matthias/vcs/github/duperemove/find_dupes.c:520:2
    #3 0x583e8785b479 in __process_duplicates /home/matthias/vcs/github/duperemove/duperemove.c:549:10
    #4 0x583e8785b479 in process_duplicates /home/matthias/vcs/github/duperemove/duperemove.c:574:3
    #5 0x583e87859e8b in main /home/matthias/vcs/github/duperemove/duperemove.c:687:3
    #6 0x71a87507ce07 in __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #7 0x71a87507cecb in __libc_start_main /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:360:3
    #8 0x583e877234d4 in _start (/home/matthias/vcs/github/duperemove/duperemove+0x5b4d4) (BuildId: 64d0c7c0e92d3386e381671445cc0bcd9c79cbf3)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior find_dupes.c:65:8

Search completed with no errors.
Simple read and compare of file data found 0 instances of extents that might benefit from deduplication.
Nothing to dedupe.
Loading only identical files from hashfile.
Simple read and compare of file data found 18 instances of files that might benefit from deduplication.
Showing 2 identical files of length 3.4KB with id baca9555
matthiaskrgr commented 3 months ago

ah lol, when I do run the same dedupe twice with identical hash file (so that the dedupe will be aborted because there is nothing new to scan according to hash file) it actually shows something like

    Files scanned: 0/0 ( -nan%)
    Bytes scanned: 0.0B/0.0B ( -nan%)

which also looks kinda suspicious :)

Gathering file list...
    Files scanned: 0/0 ( -nan%)
    Bytes scanned: 0.0B/0.0B ( -nan%)
    File listing: completed
Hashfile "haaaash" written