From owner-freebsd-current@FreeBSD.ORG Mon Jul 15 09:25:44 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6AE07715 for ; Mon, 15 Jul 2013 09:25:44 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 03194AFB for ; Mon, 15 Jul 2013 09:25:43 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id c10so2604622wiw.17 for ; Mon, 15 Jul 2013 02:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=64Hb3/3QTviP+OBXBE+nzHHl3aeOQnA6c8M3C+LEfic=; b=c9N42/2HcPMR/SvXsIlwSoGMEE8LgdXL5PSniAFiu0acDXqH2BNQ6VeYv73RP0V72J BJKYC4bBVZnAE4A/Ji8BzUtz3gd3lfRpTvExxce6ySQPKLsRWy5v+gEQYK1EQnFn0894 VwDrmOELNBseLxtlTWlQK94k3ddhfna8Pt3+L/RNy+X5bptk4yu567qfFPV/y6BV8ppR l9WaaGzPfjz6wfJimouWGlgjkQHrQdm8tGebewoGJNdP4FrNNK7usqJQTbUSihwA5uoL rKnn7zRh5m1pnkSO/YfiFxQN+kvTgD40qQ+75B59Bt4UToiyAbeli3q+N245BdlJNnBm Cbgg== X-Received: by 10.194.103.226 with SMTP id fz2mr30803009wjb.75.1373880343030; Mon, 15 Jul 2013 02:25:43 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id s19sm19490481wik.11.2013.07.15.02.25.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 15 Jul 2013 02:25:41 -0700 (PDT) Date: Mon, 15 Jul 2013 11:25:37 +0200 From: Mateusz Guzik To: "Eugene M. Zheganin" Subject: Re: r248583 Kernel panic: negative refcount 0xfffffe0031b59168 Message-ID: <20130715092537.GA22424@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , "Eugene M. Zheganin" , freebsd-current@freebsd.org References: <51CFDC86.2040506@FreeBSD.org> <20130630111836.GB22492@dft-labs.eu> <20130701231011.GA1406@garage.freebsd.pl> <51E3BDF5.7030602@norma.perm.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <51E3BDF5.7030602@norma.perm.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 15 Jul 2013 09:25:44 -0000 On Mon, Jul 15, 2013 at 03:16:37PM +0600, Eugene M. Zheganin wrote: > Hi. > > On 02.07.2013 05:10, Pawel Jakub Dawidek wrote: > > On Sun, Jun 30, 2013 at 01:18:36PM +0200, Mateusz Guzik wrote: > >> > >> Turns out the bug is quite funny ;) > >> > >> Try this: > >> diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c > >> index 5d8e814..7a4db04 100644 > >> --- a/sys/kern/uipc_usrreq.c > >> +++ b/sys/kern/uipc_usrreq.c > >> @@ -1764,8 +1764,8 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) > >> } > >> for (i = 0; i < newfds; i++, fdp++) { > >> fde = &fdesc->fd_ofiles[*fdp]; > >> - fde->fde_file = fdep[0]->fde_file; > >> - filecaps_move(&fdep[0]->fde_caps, > >> + fde->fde_file = fdep[i]->fde_file; > >> + filecaps_move(&fdep[i]->fde_caps, > >> &fde->fde_caps); > >> if ((flags & MSG_CMSG_CLOEXEC) != 0) > >> fde->fde_flags |= UF_EXCLOSE; > > Thanks for tracking it down before I had time to get to it! > > The change looks good. > > > Guys, if this is working, why it's not commited to HEAD ? I'm still > hitting this bug on r251990 and later ones. > The patch was committed in r252502. Is that kernel crashing for you? If so, can you show backtrace? -- Mateusz Guzik