From owner-freebsd-bugs Mon Oct 28 5:30: 4 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B775137B401 for ; Mon, 28 Oct 2002 05:30:02 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F8A943E88 for ; Mon, 28 Oct 2002 05:30:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9SDU1x3098558 for ; Mon, 28 Oct 2002 05:30:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9SDU1iY098557; Mon, 28 Oct 2002 05:30:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D32E237B401; Mon, 28 Oct 2002 05:20:10 -0800 (PST) Received: from a194-109-252-84.adsl.xs4all.nl (a194-109-252-84.adsl.xs4all.nl [194.109.252.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7877943E6E; Mon, 28 Oct 2002 05:20:09 -0800 (PST) (envelope-from co9@xs4all.nl) Received: by a194-109-252-84.adsl.xs4all.nl (Postfix, from userid 1001) id E37093A9C; Mon, 28 Oct 2002 14:20:53 +0100 (CET) Message-Id: <20021028132053.E37093A9C@a194-109-252-84.adsl.xs4all.nl> Date: Mon, 28 Oct 2002 14:20:53 +0100 (CET) From: Robin Schilham Reply-To: Robin Schilham To: FreeBSD-gnats-submit@FreeBSD.org Cc: peter@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: gnu/44564: [PATCH] Aborted cvs session causes an endless loop in cvs server. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 44564 >Category: gnu >Synopsis: [PATCH] Aborted cvs session causes an endless loop in cvs server. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 28 05:30:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Robin Schilham >Release: FreeBSD 4.7-STABLE i386 >Organization: >Environment: System: FreeBSD xxx.adsl.xs4all.nl 4.7-STABLE FreeBSD 4.7-STABLE #0: Tue Oct 22 22:00:40 CEST 2002 root@xxx.adsl.xs4all.nl:/usr/obj/usr/src/sys/OMNI i386 >Description: The command "cvs server" registers two signal handlers for SIGINT. As a result, SIGINT (control-C) triggers server_cleanup invocation twice. During the second invocation of server_cleanup, the assertion "fstat ( fileno (bc->fp), &s ) != -1" (buffer.c, line 1372) fails because stdin has already been closed during the first invocation of server_cleanup. Assertion failure causes a SIGABRT, which triggers server_cleanup again, resulting in an endless loop that can only be terminated by a SIGTERM. The same situation occurs when the client interrupts a cvs update or cvs checkout, leaving the server in an endless loop, and increasing the server load by 1. This bug was introduced in Concurrent Versions System (CVS) 1.11.2-FreeBSD (client/server) and does not exist in Concurrent Versions System (CVS) 1.11.1p1-FreeBSD (client/server) >How-To-Repeat: There are two ways: 1) execute "cvs server" and press control-C, or 2) do a (preferable large) cvs update or cvs checkout and press control-C during the session. >Fix: See attached patches (src/contrib/cvs/src): patch-buffer.c prevents the endless loop. patch-server.c prevents "cvs in free(): warning: chunk is already free". >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message