From owner-freebsd-current@FreeBSD.ORG Tue Feb 10 01:56:07 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13EAA16A4CE for ; Tue, 10 Feb 2004 01:56:07 -0800 (PST) Received: from smtp1.powertech.no (smtp1.powertech.no [195.159.0.145]) by mx1.FreeBSD.org (Postfix) with ESMTP id AABFC43D1F for ; Tue, 10 Feb 2004 01:56:06 -0800 (PST) (envelope-from frode@nordahl.net) Received: from [195.159.6.12] (dhcp12.ns5.powertech.no [195.159.6.12]) by smtp1.powertech.no (Postfix) with ESMTP id 1E9A38474; Tue, 10 Feb 2004 10:56:05 +0100 (CET) In-Reply-To: <20040205231849.D41237@mail.allcaps.org> References: <0703C4CC-5805-11D8-951F-000A95A9A574@nordahl.net> <20040205231849.D41237@mail.allcaps.org> Mime-Version: 1.0 (Apple Message framework v612) Content-Type: multipart/mixed; boundary=Apple-Mail-2--684483692 Message-Id: <56C69560-5BAF-11D8-A6E1-000A95A9A574@nordahl.net> From: Frode Nordahl Date: Tue, 10 Feb 2004 10:56:04 +0100 To: "Andrew P. Lentvorski, Jr." X-Mailer: Apple Mail (2.612) cc: current@freebsd.org Subject: Re: rpc.lockd(8) seg faults on 5.2-RELEASE (patch, workaround) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 09:56:07 -0000 --Apple-Mail-2--684483692 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hello, This is not a sollution, but I have run with this workaround since friday without incident. I think there are two problems: - freed items are sometimes not removed from the nfslocklist - first element in blockedlocklist sometimes get wrong, causing a infinite loop in retry_blockingfilelocklist() Mvh, Frode --Apple-Mail-2--684483692 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="rpc.lockd.patch" Content-Disposition: attachment; filename=rpc.lockd.patch diff -ru rpc.lockd/lockd_lock.c rpc.lockd.patched/lockd_lock.c --- rpc.lockd/lockd_lock.c Sun Oct 26 07:10:44 2003 +++ rpc.lockd.patched/lockd_lock.c Tue Feb 10 10:46:41 2004 @@ -385,7 +385,7 @@ if (newfl == NULL) { return NULL; } - bzero(newfl, sizeof(newfl)); + bzero(newfl, sizeof(*newfl)); newfl->client.oh.n_bytes = malloc(lockowner->n_len); if (newfl->client.oh.n_bytes == NULL) { @@ -438,6 +438,7 @@ void deallocate_file_lock(struct file_lock *fl) { + LIST_REMOVE(fl, nfslocklist); free(fl->client.oh.n_bytes); free(fl->client_cookie.n_bytes); free(fl); @@ -1246,6 +1247,12 @@ * current element has been moved */ nfl = LIST_NEXT(ifl, nfslocklist); + + if (nfl == ifl) { + debuglog("nfl == ifl, resetting nfl\n"); + nfl = NULL; + } + debuglog("Iterator choice %p\n",ifl); debuglog("Prev iterator choice %p\n",pfl); debuglog("Next iterator choice %p\n",nfl); @@ -2152,7 +2159,7 @@ static struct nlm4_res retval4; debuglog("About to send granted on blocked lock\n"); - sleep(1); + sleep(debugdelay); debuglog("Blowing off return send\n"); cli = get_client(fl->addr, --Apple-Mail-2--684483692 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On Feb 6, 2004, at 08:21, Andrew P. Lentvorski, Jr. wrote: > On Thu, 5 Feb 2004, Frode Nordahl wrote: > >> I also found this in send_granted(): lockd_lock.c:2161 >> >> debuglog("About to send granted on blocked lock\n"); >> sleep(1); >> debuglog("Blowing off return send\n"); >> >> Anyone know what sleep(1) is good for here? > > The sleep() statements near debuglog() stuff are to work around the > fact > that syslog has bugs where it arbitrarily and randomly eats messages > when > you start sending too much data at it too quickly. > > By slowing down the logging, all of the messages get recorded. > > -a > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" --Apple-Mail-2--684483692--