From owner-freebsd-current@freebsd.org Thu Sep 22 15:13:34 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82D5CBE5488 for ; Thu, 22 Sep 2016 15:13:34 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F4BAEB3 for ; Thu, 22 Sep 2016 15:13:34 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id b130so153954748wmc.0 for ; Thu, 22 Sep 2016 08:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MPp8XkRLu+Y7DJgzmez3B4IFTzNUcqKOmdgFotmGrPU=; b=gCeiNI1AE0nsuhH72tWzN4fsWaUrsbecMQAFwlCa0BZoTvP4H5ETaL6TLgmwk5CTLk raGpRaL84gfsPzgjUGjwQ/NYAl9B9uP4xdU887gF4BSkKs9DlfEmFe5gbSIzu06EcdCK y3Gk4kUGR5PncgO/6uknL+PUYRkKbiZTibkkqVjGPIKr3/l+153WMylrtv+woD5Ydt90 nOarYW2iBig/bOjMXn2JUexUoQsS7zjtVYE6I++Z7n6LRlUlRzYdI4gS6obeb9xCZoj8 L/Pp5uaOwyHg9grPoFiqbPmXzgsYicYkYIraljn5caVF2UV3qwlDKZpxa3HJg2I81O/v Q9aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=MPp8XkRLu+Y7DJgzmez3B4IFTzNUcqKOmdgFotmGrPU=; b=LPKTRJauSEu5ood41Qfmn1NjGaFd+43p/TbBheb6Kf+JayUpuYjjgHKGVzwMyAR8h/ zU1VoOR/Lb2nGLmR020lovvn5ECk08nEfOhngsmDD5Q3bj1ZORFMcs2q4Z+VSjrvgvGe 9lAcH432JC/pQCazA0gtwRY1pZy5M//B9UC2xs0S7XVhp+HE+WAEj1ncKK/W9JySlKZ/ gjLYgAqpYJja7Us0hKf95h+L6mkADvujEKsVxaVYjtDygKnIJrgRgsaWmYLBKyY/UmEU NXmvgMzAdDWKYgwqrnzB7RJyu8f80fhYY3v8ig/bgEfPGAZKbyYSAtTx4HdFIgE6ZyJv kmyA== X-Gm-Message-State: AE9vXwNaE0vG4DPMyjpwgMeF2pDWFqWo0Owq+2gBoFLff7KIV8hBfa3YPZnwujryiIAjag== X-Received: by 10.194.87.227 with SMTP id bb3mr2513655wjb.62.1474557212496; Thu, 22 Sep 2016 08:13:32 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id f10sm2565719wje.14.2016.09.22.08.13.31 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 22 Sep 2016 08:13:31 -0700 (PDT) Date: Thu, 22 Sep 2016 17:13:29 +0200 From: Mateusz Guzik To: Ben Woods , FreeBSD Current Subject: Re: Kernel crashes from turnstile_broadcast (/usr/src/sys/kern/subr_turnstile.c:837) Message-ID: <20160922151329.GB9643@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Ben Woods , FreeBSD Current References: <20160922130141.GA9643@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160922130141.GA9643@dft-labs.eu> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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, 22 Sep 2016 15:13:34 -0000 On Thu, Sep 22, 2016 at 03:01:41PM +0200, Mateusz Guzik wrote: > On Thu, Sep 22, 2016 at 08:48:29PM +0800, Ben Woods wrote: > > #13 0xffffffff80b4d91c in turnstile_broadcast (ts=0x0, queue=1) at > > /usr/src/sys/kern/subr_turnstile.c:837 > > #14 0xffffffff80ae5e1f in __rw_wunlock_hard (c=0xfffff803f886d960, > > tid=, file=, line= > optimized out>) > > at /usr/src/sys/kern/kern_rwlock.c:1027 > > can you please: > f 14 > x/xg c > After a quick look I think this is a race within the facility itself. It can set the RW_LOCK_WRITE_SPINNER flag, which will trigger the wunlock_hard path which expects a blocked thread. But by that time the contending thread is not necessarily on the turnstile yet, and it may not even go there in the first place. I'll investigate more tomorrow. -- Mateusz Guzik