From nobody@FreeBSD.org  Tue Feb 22 07:24:20 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3F14106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Feb 2011 07:24:20 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id A2E688FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Feb 2011 07:24:20 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p1M7OJw2008822
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Feb 2011 07:24:19 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p1M7OJxc008821;
	Tue, 22 Feb 2011 07:24:19 GMT
	(envelope-from nobody)
Message-Id: <201102220724.p1M7OJxc008821@red.freebsd.org>
Date: Tue, 22 Feb 2011 07:24:19 GMT
From: Alexander Zagrebin <alex@zagrebin.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: csup in the CVS mode  terminates before it applies all required fixups
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         154954
>Category:       bin
>Synopsis:       [patch] csup(1) in the CVS mode  terminates before it applies all required fixups
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    adrian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 22 07:30:11 UTC 2011
>Closed-Date:    Sat Sep 15 23:47:34 UTC 2012
>Last-Modified:  Sat Sep 15 23:47:34 UTC 2012
>Originator:     Alexander Zagrebin
>Release:        8.2-PRERELEASE
>Organization:
-
>Environment:
FreeBSD gw.xxxx.xx 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #3: Thu Jan 27 19:17:37 MSK 2011     root@gw.xxxx.xx:/usr/src/sys/amd64/compile/KERNEL  amd64
>Description:
It seems that csup has a bug in a fixups handling.
csup doesn't downloads all required files during an "Applying fixups for collection..." stage.
For example, after new CVS tag created in the 'src' part of the FreeBSD master CVS repository, a csup have to download a whole src tree (due to a checksum mismatching). But really it downloads, for example, the 'src/bin', 'src/cddl' only and finishes successfully. On next run the csup downloads, for example again, 'src/contrib' and  'src/crypto' and stops again. And so on.

>How-To-Repeat:
Try to update a CVS tree using csup after a lot of changes in the 'src' (for example, after a new branch/tag is created in the repository).
csup will not update all required files at once, so multiple runs of csup are required for successful updating of the CVS tree.

>Fix:
When an updater thread completes its job, it "closes" the list of fixups by invoking fixups_close. After this, the function fixups_get always returns NULL, despite the fact that there are fixups in the list.
The attached patch fixes this issue.

Patch attached with submission follows:

--- contrib/csup/fixups.c.orig	2010-11-02 11:31:02.685298679 +0300
+++ contrib/csup/fixups.c	2011-02-18 15:54:02.641377110 +0300
@@ -141,7 +141,7 @@ fixups_get(struct fixups *f)
 	fixups_lock(f);
 	while (f->size == 0 && !f->closed)
 		pthread_cond_wait(&f->cond, &f->lock);
-	if (f->closed) {
+	if (f->size == 0) {
 		fixups_unlock(f);
 		return (NULL);
 	}


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->adrian 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Sun Sep 18 09:51:02 UTC 2011 
Responsible-Changed-Why:  
I'll take it 


http://www.freebsd.org/cgi/query-pr.cgi?pr=154954 
State-Changed-From-To: open->patched 
State-Changed-By: adrian 
State-Changed-When: Mon Mar 26 23:17:03 UTC 2012 
State-Changed-Why:  
Patched in SVN r225980. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=154954 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Sat Sep 15 23:47:30 UTC 2012 
State-Changed-Why:  
mfced some time ago 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154954 
>Unformatted:
