[Bug 8265] Various corruption of devices and sockets

samba-bugs at samba.org samba-bugs at samba.org
Sun Jun 26 10:11:35 MDT 2011


--- Comment #8 from Matt McCutchen <matt at mattmccutchen.net> 2011-06-26 16:11:35 UTC ---
(In reply to comment #7)
> Not sure if the patch is ok, rsync stalls in some different cases
> and needs ctrl-c.

As you can see, all the patch does is add print statements, so the hang must be
the result of a timing-dependent bug that was triggered by the addition of the
debug output.

> # rsync -nHaxi --delete /dev/ ./empty/
> ...
> [sender] i=4302 /dev zs0 mode=020600 len=0 uid=0 gid=0 flags=0
> [sender] i=4303 /dev fd/ mode=040555 len=1024 uid=0 gid=0 flags=4
> send_file_list done
> file list sent
> ^C[sender] _exit_cleanup(code=20, file=rsync.c, line=549): entered
> rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(549)
> [sender=3.0.8]
> [sender] _exit_cleanup(code=20, file=rsync.c, line=549): about to call exit(20)
> rsync: writefd_unbuffered failed to write 96 bytes to socket [Receiver]: Broken
> pipe (32)
> DEBUG 9: make_file(./fd1.1440): major(tmp_rdev) = 9
> DEBUG 1: send_file_entry(fd1.1440): major(rdev) = 9
> DEBUG 3: send_file_entry(fd1.1440): XMIT_SAME_RDEV_MAJOR
> DEBUG 9: make_file(./rfd1.1440): major(tmp_rdev) = 9
> DEBUG 1: send_file_entry(rfd1.1440): major(rdev) = 9
> DEBUG 6: recv_file_entry(fd1.1440): XMIT_SAME_RDEV_MAJOR, rdev_major was 3

Well that's interesting, the receiver's rdev_major value got out of sync with
the sender's.  recv_file_entry::rdev_major is zero-initialized and the only
assignment to it is instrumented with "DEBUG 5", so unless you redacted a
previous device with major number 3 from the output, the value 3 could only
appear via memory corruption.

The fastest way to find the problem is probably to use a gdb watchpoint, like

$ gdb --args rsync -nHaxi --delete /dev/ ./empty/
(gdb) set follow-fork-mode child
(gdb) watch recv_file_entry::rdev_major
(gdb) run
(gdb) bt

You could also try running rsync under valgrind if convenient.

Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the rsync mailing list