From owner-freebsd-stable@FreeBSD.ORG Wed Jul 4 16:51:26 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E8531065670 for ; Wed, 4 Jul 2012 16:51:26 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 80FA68FC17 for ; Wed, 4 Jul 2012 16:51:25 +0000 (UTC) Received: by bkcje9 with SMTP id je9so2439361bkc.13 for ; Wed, 04 Jul 2012 09:51:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=R9IIVDgfMQWoGorAXcPvwyVe5mn3a0gXv3uzwUM1YZU=; b=ByKvn5Tar6YxGbOA5f/69H2sz/089loP+PseoRTPyVo+5RzOLS3ZMvlDny7W3HIuvM tff37qNLBIRE95qFrh1J7CFOS7lL2v4nzOCON+AX2G4WWB3WcHGYret88bIG/G9qpTj/ Nmeg2ECojUXKqoYJgOE3JP1QLIsmBkvbVDtnRp7DEo3LDUNUaHx9K8mm3EBEANDkde8X mKYhVxL0Lv6uLS8qfmehXWw5CesgpYAi6W6U4+buRxSbfM+NpENxu5ccyxmZlYYm4HOU m+JQsg5ICD8V1lvWOTAI88YwXOOFdvKaKLHdV+yEuHxV38pHxbfcTQ3lHJ6ZeMMjBfAB 9esA== Received: by 10.204.157.6 with SMTP id z6mr2784583bkw.25.1341420684137; Wed, 04 Jul 2012 09:51:24 -0700 (PDT) Received: from amy.lab.techwires.net (dslb-088-065-209-016.pools.arcor-ip.net. [88.65.209.16]) by mx.google.com with ESMTPS id h18sm19341237bkh.8.2012.07.04.09.51.22 (version=SSLv3 cipher=OTHER); Wed, 04 Jul 2012 09:51:23 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: freebsd-stable@freebsd.org Date: Wed, 4 Jul 2012 18:51:56 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.0-STABLE; KDE/4.7.4; amd64; ; ) References: <20120507035405.GA47351@regency.nsu.ru> <20120619052810.GA40402@regency.nsu.ru> In-Reply-To: <20120619052810.GA40402@regency.nsu.ru> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201207041851.56283.bschmidt@freebsd.org> X-Gm-Message-State: ALoCoQnp2aIzCqjquxiSKNcLP8tR9uA8wQMW/7QNN1KKNPxdyYhO4+NbUF7MnDJKQwx3LKF1dbk6 Cc: Alexey Dokuchaev Subject: Re: panic with if_iwi(4) upon "netif restart" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2012 16:51:26 -0000 On Tuesday 19 June 2012 07:28:11 Alexey Dokuchaev wrote: > On Mon, May 07, 2012 at 08:28:50PM +0200, Bernhard Schmidt wrote: > > On Mon, May 7, 2012 at 5:54 AM, Alexey Dokuchaev wrote: > > > Weird panic occurs to me here with iwi(4) based laptop when trying to hook > > > up to WPA-protected network with "service netif restart". Kernel and > > > userland are not strictly in sync, with the latter lagging behind couple > > > of months, but presumably this fact should not matter on stable branch. > > > > does "ps" in kgdb reveal multiple instances of wpa_supplicant running? > > If so, this seems to be the well known devd+netif+supplicant+newstate > > race/missing refcount. > > > > Wanna try attached patch? > > Bernhard, > > Sorry it took so long to get back. With your patch applied, I haven't > seen this panic for a while, however, double instances of wpa_supplicant > still persist. So I think you can commit it, but underlying race remains > to be fixed. Ok, thanks. The patch is indeed supposed to only fix the panics. The underlying problem is that a "netif restart" results in 2 calls to "netif wlan0 start", one through the call itself the other due an event sent to devd. wpa_supplicant itself has a small window were it is possible that 2 instances are attached to one resource. I have yet to find a solution for this without adding any regressions. -- Bernhard