Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Sep 2011 14:58:15 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-stable@freebsd.org
Cc:        lulf@freebsd.org, Dmitry Morozovsky <marck@rinet.ru>
Subject:   Re: csup crash
Message-ID:  <201109121458.15661.jhb@freebsd.org>
In-Reply-To: <alpine.BSF.2.00.1109120957000.17912@woozle.rinet.ru>
References:  <alpine.BSF.2.00.1109120957000.17912@woozle.rinet.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, September 12, 2011 2:01:16 am Dmitry Morozovsky wrote:
> Dear colleagues,
> 
> I found csup is crashing on my building machine on some broken repo element, 
> but cannot quickli realize what's the source of problem

What OS version are you running?  I wonder if you have this fix:

------------------------------------------------------------------------
r213300 | jhb | 2010-09-30 10:28:48 -0400 (Thu, 30 Sep 2010) | 9 lines

If an RCS file is truncated, rcsfile_getdelta() will return NULL.  Instead
of faulting, check for NULL.  However, returning an error would cause csup
to just abort the entire update.  Instead, break out of the loop and
return ok.  The attempts to update the file will trigger a MD5 failure which
will cause csup to download the entire file as a fixup.

Reviewed by:    lulf
MFC after:      1 week

------------------------------------------------------------------------
Index: rcsparse.c
===================================================================
--- rcsparse.c  (revision 213299)
+++ rcsparse.c  (revision 213300)
@@ -318,6 +318,14 @@
                d = rcsfile_getdelta(rf, revnum);
                free(revnum);
 
+               /*
+                * XXX: The RCS file is corrupt, but lie and say it is ok.
+                * If it is actually broken, then the MD5 mismatch will
+                * trigger a fixup.
+                */
+               if (d == NULL)
+                       return (0);
+
                /* log string */
                asserttoken(sp, KEYWORD);
                asserttoken(sp, STRING);

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109121458.15661.jhb>