From owner-freebsd-stable@FreeBSD.ORG Mon Sep 12 18:58:17 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A781065673; Mon, 12 Sep 2011 18:58:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id ED20C8FC0A; Mon, 12 Sep 2011 18:58:16 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A5BFA46B0A; Mon, 12 Sep 2011 14:58:16 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 308E28A02E; Mon, 12 Sep 2011 14:58:16 -0400 (EDT) From: John Baldwin To: freebsd-stable@freebsd.org Date: Mon, 12 Sep 2011 14:58:15 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201109121458.15661.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 12 Sep 2011 14:58:16 -0400 (EDT) Cc: lulf@freebsd.org, Dmitry Morozovsky Subject: Re: csup crash X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2011 18:58:17 -0000 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