strange crash with md5p8.diff + xxhash

Madhu enometh at meer.net
Sun Sep 27 15:44:36 UTC 2020


With rsync-patches/md5p8.diff and --enable-xxhash

% gdb --args ./rsync --version
Using host libthread_db library "/lib64/libthread_db.so.1".
rsync  version v3.2.3-29-ge55788bd  protocol version 31
Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, symlinks, symtimes, hardlinks, hardlink-specials,
    hardlink-symlinks, IPv6, atimes, batchfiles, inplace, append, ACLs,
    xattrs, optional protect-args, iconv, prealloc, stop-at, no crtimes
Optimizations:
    SIMD, asm, openssl-crypto
Checksum list:

Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
65              VPCMPEQ (%rdi), %ymm0, %ymm1
(gdb) back
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
#1  0x000000000045274b in strlcpy (d=d at entry=0x7fffffffbe7f "",
    s=0x100000000 <error: Cannot access memory at address 0x100000000>,
    bufsize=bufsize at entry=209) at lib/compat.c:120
#2  0x0000000000435903 in get_default_nno_list (
    nno=0x47e840 <valid_checksums>,
    to_buf=to_buf at entry=0x7fffffffbe50 "xxh128 xxh3 xxh64 (xxhash) md5p8 md5 md4 none (", to_buf_len=to_buf_len at entry=256, dup_markup=dup_markup at entry=40 '(')
    at compat.c:478
#3  0x000000000043d717 in print_rsync_version (f=f at entry=FINFO) at usage.c:194
#4  0x000000000042fcee in parse_arguments (argc_p=argc_p at entry=0x7fffffffc0dc,
    argv_p=argv_p at entry=0x7fffffffc0d0) at options.c:1897
#5  0x0000000000404de1 in main (argc=<optimized out>, argv=<optimized out>)
    at main.c:1747

%%

Turns out the comment in rsync.h: (struct name_num_obj):
	struct name_num_item list[8]; /* A big-enough len (we'll get a compile error if it is ever too small) */

isn't correct. I don't get a compile error. (gcc version 9.2.0 (Gentoo
9.2.0-r3 p4)) and there are more than 8 elements in
checksum.c: (valid_checksums)




More information about the rsync mailing list