Dave Dykstra
2002-Jan-30 08:36 UTC
Fix for "Warning: unexpected read size of 0 in map_ptr" in rsync 2.5.2
I upgraded to rsync 2.5.2 and started to get the error Warning: unexpected read size of 0 in map_ptr when sending just about any file from a Solaris 2.5.1 system to Linux systems, and then the file that is sent ends up being the wrong size. Through gdb and trial & error I discovered that if I back out the security fix in rsync.h at http://cvs.samba.org/cgi-bin/cvsweb/rsync/rsync.h.diff?r1=1.116&r2=1.117&f=h and recompile match.c on only the sender side then the problem goes away. Further trial & error resulted in the patch below to fix the problem. Martin, I think this is probably serious enough to warrant an immediate new release. - Dave Dykstra --- match.c.O Tue Jan 29 15:31:37 2002 +++ match.c Tue Jan 29 15:31:54 2002 @@ -246,7 +246,7 @@ match. The 3 reads are caused by the running match, the checksum update and the literal send. */ - if (offset-last_match >= CHUNK_SIZE+s->n && + if (offset-last_match >= CHUNK_SIZE+(int)s->n && (end-offset > CHUNK_SIZE)) { matched(f,s,buf,offset - s->n, -2); }
Dave Dykstra
2002-Jan-31 10:01 UTC
Fix for "Warning: unexpected read size of 0 in map_ptr" in rsync 2.5.2
I happened to notice that Redhat fixed this on Sunday already: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=58878 I wish one of them would have reported it to rsync@samba.org. - Dave Dykstra On Tue, Jan 29, 2002 at 03:36:18PM -0600, Dave Dykstra wrote:> I upgraded to rsync 2.5.2 and started to get the error > Warning: unexpected read size of 0 in map_ptr > when sending just about any file from a Solaris 2.5.1 system to Linux > systems, and then the file that is sent ends up being the wrong size. > > Through gdb and trial & error I discovered that if I back out the security > fix in rsync.h at > http://cvs.samba.org/cgi-bin/cvsweb/rsync/rsync.h.diff?r1=1.116&r2=1.117&f=h > and recompile match.c on only the sender side then the problem goes away. > Further trial & error resulted in the patch below to fix the problem. > > Martin, I think this is probably serious enough to warrant an immediate new > release. > > - Dave Dykstra > > > --- match.c.O Tue Jan 29 15:31:37 2002 > +++ match.c Tue Jan 29 15:31:54 2002 > @@ -246,7 +246,7 @@ > match. The 3 reads are caused by the > running match, the checksum update and the > literal send. */ > - if (offset-last_match >= CHUNK_SIZE+s->n && > + if (offset-last_match >= CHUNK_SIZE+(int)s->n && > (end-offset > CHUNK_SIZE)) { > matched(f,s,buf,offset - s->n, -2); > }