From owner-freebsd-current@freebsd.org Wed Apr 11 17:32:45 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2587F81F54 for ; Wed, 11 Apr 2018 17:32:45 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 3212A6CE03 for ; Wed, 11 Apr 2018 17:32:45 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id E71DBF81F53; Wed, 11 Apr 2018 17:32:44 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C023FF81F52 for ; Wed, 11 Apr 2018 17:32:44 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-ot0-x232.google.com (mail-ot0-x232.google.com [IPv6:2607:f8b0:4003:c0f::232]) (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 4E15E6CDF5 for ; Wed, 11 Apr 2018 17:32:44 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-ot0-x232.google.com with SMTP id m22-v6so2894566otf.8 for ; Wed, 11 Apr 2018 10:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=AYxvebcih2VGiaEHnKkf09W8/PJmtclXx6xfZyXEIXI=; b=ZEVfM0p5O+ERuuI4X2pOeQPQ+mgXzJ0js/Kr+OrDdBDZUhqd3cd5u3+BE1OEBnOFgz gRPGIk6hKxjsDqcncTHhPHX0tgrXMpUXY1M8pdiDUtGegiCtAp4VtFgRkqThnZmPMj+0 GSjBnB902UxU9wsAJNfCHJf28LvRZSg2uLFsaK3RtYJqeffduHA5wOYbuYUlzbFCF0A0 PBAi3m/Czm7iNEFklU1x6HZQhvwnL2czwihJMnVgJu0MNx4c6BvMJdAnGbjh/z/LvvqQ PUUSankFO5fW2kVlvQ9XY8hQ8oQNKvBp3bFtWmrJmkhIJOMMqejI0BI6+10FU7zQn1Ea OE+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=AYxvebcih2VGiaEHnKkf09W8/PJmtclXx6xfZyXEIXI=; b=nhPHX4+C7rtnzDW/pUJf0oIQNCx7K1tYjDVPBZXk4RSSbd3x/cgEJ+u6vpvnVQzzrV p0f4j6TXPzF+JpWHKVZr+iYZXr9+FqyFIVks5eBbCi9HoRkjB0g9rwR7FMZOqtcbTEkm dJxqxxw9OShI5RnH9SLvUqP+4qwjD6swmaSJpxw60AW4rpibbftqar8TfkYWM/HlUHUl j/WVDx4H7dCAahU/sz1wOSCE9b42OcqIk2fvPyZGZEaKfnl+ezqpG154ij4WVHjLBEHK oHQTM4NTDdt8KpQPWx4Sf6YzaBlSPHIeDIlqyuhubSmek8qhYCfLbdVhNH12Hoy+vM4k /TrA== X-Gm-Message-State: ALQs6tDKzl5NvCUe5v0TAPt47NAviGRV/QABRWunDRJYsU4ikhhTUNG2 e5cVUExTCQZKNdIQ13GB5/2srhGcHbaFvGNNdWE= X-Google-Smtp-Source: AIpwx48GKLhAJAZQqeBGZ9UFD6KtgAxUPr9Ji4ppFCdD4mGZBBlIe4zX/FWKoEqIHDE6sT8b6NLoCHxcCBtDt5ntGo0= X-Received: by 2002:a9d:4a77:: with SMTP id d52-v6mr2887532otj.136.1523467963559; Wed, 11 Apr 2018 10:32:43 -0700 (PDT) MIME-Version: 1.0 Sender: kmacybsd@gmail.com Received: by 2002:a9d:4782:0:0:0:0:0 with HTTP; Wed, 11 Apr 2018 10:32:42 -0700 (PDT) In-Reply-To: References: <20180411113958.GE1134@albert.catwhisker.org> From: "K. Macy" Date: Wed, 11 Apr 2018 10:32:42 -0700 X-Google-Sender-Auth: Gg8BKreWXm6W4oAUNUEDs_VN3lQ Message-ID: Subject: Re: panic: mtx_lock() of spin mutex (null) @ /usr/src/sys/net/iflib.c:3716 To: David Wolfskill , current@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 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: Wed, 11 Apr 2018 17:32:45 -0000 Chalk another review fail up to shuffling patches between git and phab. Sorry for the inconvenience. -M On Wed, Apr 11, 2018 at 10:26 AM, K. Macy wrote: > Actually ctx lock is still a mutex. Just add the STATE_LOCK_INIT line. > -M > > On Wed, Apr 11, 2018 at 10:24 AM, K. Macy wrote: >> Sorry about that. It looks like my review must have been missing a line. >> >> @@ -4702,8 +4707,8 @@ iflib_register(if_ctx_t ctx) >> >> _iflib_assert(sctx); >> >> - CTX_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); >> - >> + CTX_LOCK_INIT(ctx); >> + STATE_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); >> ifp = ctx->ifc_ifp = if_gethandle(IFT_ETHER); >> if (ifp == NULL) { >> device_printf(dev, "can not allocate ifnet structure\n"); >> @@ -5430,8 +5435,8 @@ iflib_io_tqg_attach(struct grouptask *gt, void >> *uniq, int cpu, char *name) >> } >> >> void >> >> On Wed, Apr 11, 2018 at 4:39 AM, David Wolfskill wrote: >>> This was running: >>> >>> FreeBSD g1-215.catwhisker.org 12.0-CURRENT FreeBSD 12.0-CURRENT #156 r332399M/332400:1200061: Wed Apr 11 04:17:45 PDT 2018 root@g1-215.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY amd64 >>> >>> during boot, after updating from: >>> >>> FreeBSD g1-215.catwhisker.org 12.0-CURRENT FreeBSD 12.0-CURRENT #155 r332354M/332357:1200061: Tue Apr 10 04:00:41 PDT 2018 root@g1-215.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY amd64 >>> >>> (My build machine, which uses an re((4) NIC, did not encounter the issue.) >>> >>> It appears that r332389 is implicated. >>> >>> ... >>> Unread portion of the kernel message buffer: >>> >>> __curthread () at ./machine/pcpu.h:230 >>> 230 __asm("movq %%gs:%1,%0" : "=r" (td) >>> (kgdb) #0 __curthread () at ./machine/pcpu.h:230 >>> #1 doadump (textdump=3) at /usr/src/sys/kern/kern_shutdown.c:361 >>> #2 0xffffffff80433f4c in db_fncall_generic (addr=, >>> rv=, nargs=, args=) >>> at /usr/src/sys/ddb/db_command.c:609 >>> #3 db_fncall (dummy1=, dummy2=, >>> dummy3=, dummy4=) >>> at /usr/src/sys/ddb/db_command.c:657 >>> #4 0xffffffff80433a99 in db_command (last_cmdp=, >>> cmd_table=, dopager=) >>> at /usr/src/sys/ddb/db_command.c:481 >>> #5 0xffffffff80433814 in db_command_loop () >>> at /usr/src/sys/ddb/db_command.c:534 >>> #6 0xffffffff80436a3f in db_trap (type=, code=) >>> at /usr/src/sys/ddb/db_main.c:250 >>> #7 0xffffffff80b753e3 in kdb_trap (type=3, code=-61456, tf=) >>> at /usr/src/sys/kern/subr_kdb.c:697 >>> #8 0xffffffff80f7eaa8 in trap (frame=0xfffffe00004377a0) >>> at /usr/src/sys/amd64/amd64/trap.c:548 >>> #9 >>> #10 kdb_enter (why=0xffffffff811df9d4 "panic", msg=) >>> at /usr/src/sys/kern/subr_kdb.c:479 >>> #11 0xffffffff80b2feda in vpanic (fmt=, ap=0xfffffe0000437910) >>> at /usr/src/sys/kern/kern_shutdown.c:826 >>> #12 0xffffffff80b2fca0 in kassert_panic ( >>> fmt=0xffffffff811dadca "mtx_lock() of spin mutex %s @ %s:%d") >>> at /usr/src/sys/kern/kern_shutdown.c:723 >>> #13 0xffffffff80b0ec93 in __mtx_lock_flags (c=0xfffff80008c85d88, opts=0, >>> file=0xffffffff81113c90 "/usr/src/sys/net/iflib.c", line=) >>> at /usr/src/sys/kern/kern_mutex.c:246 >>> #14 0xffffffff80c466e1 in _task_fn_admin (context=0xfffff80008c85c00) >>> at /usr/src/sys/net/iflib.c:3716 >>> #15 0xffffffff80b73849 in gtaskqueue_run_locked (queue=0xfffff80008489500) >>> at /usr/src/sys/kern/subr_gtaskqueue.c:331 >>> #16 0xffffffff80b735c8 in gtaskqueue_thread_loop (arg=) >>> at /usr/src/sys/kern/subr_gtaskqueue.c:506 >>> #17 0xffffffff80af0064 in fork_exit ( >>> callout=0xffffffff80b73540 , >>> arg=0xfffffe0844223008, frame=0xfffffe0000437ac0) >>> at /usr/src/sys/kern/kern_fork.c:1039 >>> #18 >>> (kgdb) >>> >>> If the dump would be useful, I can put it up for access. >>> >>> Peace, >>> david >>> -- >>> David H. Wolfskill david@catwhisker.org >>> Well, what did you EXPECT from Trump? He has a history of breaking promises. >>> >>> See http://www.catwhisker.org/~david/publickey.gpg for my public key.