[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Crash in translated_stream_read

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-12-09 17:50:52 CET

Michael Pilato wrote:
> On Fri, 2005-12-09 at 14:09 +0000, Julian Foad wrote:
>
>>As of a few days ago, I'm getting seg. faults when trying to "svn update" my
>>Subversion WC. They occur at various places in the tree, and can also occur
>>during "svn cleanup".

It fails on files that are longer than 100 KB. Operations such as "svn up" can
also corrupt the working copy of such files. Several such files were corrupted
in my WC; I don't know whether "svn" had seg-faulted on each one or whether (as
I suspect) sometimes it happens silently.

The bug appears to be that translated_stream_read() goes wrong after
SVN_STREAM_CHUNK_SIZE bytes. A fix is:

Index: subversion/libsvn_subr/subst.c
===================================================================
--- subversion/libsvn_subr/subst.c (revision 17559)
+++ subversion/libsvn_subr/subst.c (working copy)
@@ -1049,6 +1049,7 @@ translated_stream_read (void *baton,
            svn_stream_t *buf_stream;

            svn_stringbuf_setempty (b->readbuf);
+ b->readbuf_off = 0;
            SVN_ERR (svn_stream_read (b->stream, b->buf, &readlen));
            buf_stream = svn_stream_from_stringbuf (b->readbuf, iterpool);

> Yep, I was seeing those, too. Took me *hours* to finally get my
> Subversion working copy updated. You should check your versioned file
> contents, too -- IIRC, my text-bases and working files were getting
> filled with garbage (huge blocks of NULL bytes).

For those who still need to fix their WC files, I found that "svn cat $F > $F"
works if the text-base is in tact. The following will find any files that
differ from their text bases (but is slow):

   for F in `svn ls -R | grep -v "/$"`; do svn cat $F | diff -q - $F; done

> I'm now running r17597 and haven't seen the problems any more.

Well, I don't see any evidence that the bug has been fixed: I think it may have
temporarily been hidden by some side effect of changing SVN_STREAM_CHUNK_SIZE
from 100 KB to 16 KB.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 9 17:51:57 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.