csup crash
John Baldwin
jhb at freebsd.org
Mon Sep 12 18:58:17 UTC 2011
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
More information about the freebsd-stable
mailing list