From owner-freebsd-current@FreeBSD.ORG Thu Apr 23 16:11:11 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71222106566C for ; Thu, 23 Apr 2009 16:11:11 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.30]) by mx1.freebsd.org (Postfix) with ESMTP id 235748FC15 for ; Thu, 23 Apr 2009 16:11:11 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so154411ywe.13 for ; Thu, 23 Apr 2009 09:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=14tRwc5lTunpkXQ0lGEeAggiWqy/THm2tvqOwHHhWqg=; b=VAP4FEkKuLjNHI/M1OsXT3IISwkFR431fYhQ8AJCX6hNu2SmCHHS76O6L3dFUL4FR0 yLlxHUIN7KyZeCzhqAJE4Ikc63Ud4TtRnKSXS4gs/4smh7gtm7WIizTPJ8xCXFabrwtr Uq/01prw9bUgFI7MtA7BP62tXGwg1/rbEvpbE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=FUphTTj6Wc3K3SyHKxCn8ZtBSDXW7tuv4vmIxvinrMI9km/y/lRIf/6mbmGF1cumwT henjWRPisxgRv7SVk2oq2xjQJ+u/x+aM2xVVD0sKH1d4X/GksZG+eUGdO6PjLPOeCnd7 +dRsTG7oNcNZTvBIDQskI2mMDOOCQ/HgGdldk= MIME-Version: 1.0 Received: by 10.90.72.3 with SMTP id u3mr1420342aga.6.1240503070522; Thu, 23 Apr 2009 09:11:10 -0700 (PDT) In-Reply-To: References: Date: Thu, 23 Apr 2009 09:11:10 -0700 Message-ID: From: Maksim Yevmenkin To: pluknet Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alexander Best , freebsd-current@freebsd.org Subject: Re: possible bug in the sbappendrecord_locked()? (Was: Re: core dump with bluetooth device) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 23 Apr 2009 16:11:11 -0000 On Thu, Apr 23, 2009 at 1:56 AM, pluknet wrote: > 2009/4/18 pluknet : >> 2009/4/17 Maksim Yevmenkin : >>> > [snip] >>> >>> ok, this is completely untested, so be warned :) would something like >>> the following work? am i missing something? >> >> I'm on vacations and will not able to test it until after 4/23. :( >> > > So, come back now. > > Works for me (tm) on stable/7 with SOCKBUF_DEBUG enabled. > (writing this message currently via ng_ubt(4)). > Please, commit. thanks! i've committed slightly different patch to -head, but the idea is still the same. === SVN rev 191366 on 2009-04-21 19:14:13Z by emax Fix sbappendrecord_locked(). The main problem is that sbappendrecord_locked() relies on sbcompress() to set sb_mbtail. This will not happen if sbappendrecord_locked() is called with mbuf chain made of exactly one mbuf (i.e. m0->m_next == NULL). In this case sbcompress() will be called with m == NULL and will do nothing. I'm not entirely sure if m == NULL is a valid argument for sbcompress(), and, it rather pointless to call it like that, but keep calling it so it can do SBLASTMBUFCHK(). The problem is triggered by the SOCKBUF_DEBUG kernel option that enables SBLASTRECORDCHK() and SBLASTMBUFCHK() checks. PR: kern/126742 Investigated by: pluknet < pluknet -at- gmail -dot- com > No response from: freebsd-current@, freebsd-bluetooth@ MFC after: 3 days == thanks, max