From owner-freebsd-current@FreeBSD.ORG Mon Aug 22 11:08:47 2011 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 4744C1065693; Mon, 22 Aug 2011 11:08:47 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id E509F8FC15; Mon, 22 Aug 2011 11:08:46 +0000 (UTC) Received: by gxk28 with SMTP id 28so3904577gxk.13 for ; Mon, 22 Aug 2011 04:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=66lEGglPaxeZy9wMNytxAmQVR+EwO3CfiSZ7qbHWLTM=; b=oYWblFk84xZ/LpzHxEa5DP5KiSjSbotJORAZDti3H19Bflj0u3gAfu/96DTr9MFroE GhRWIupHZxKheM1X5r70JySv5o9rnoaLpzOedSkqPD7DnM5C3OUV0RyLUDORxxsTzKxb eLTB26fXXMu3ewqeFPmi7q/lu7XDLSEWOz19M= MIME-Version: 1.0 Received: by 10.150.14.3 with SMTP id 3mr2338959ybn.425.1314011326080; Mon, 22 Aug 2011 04:08:46 -0700 (PDT) Received: by 10.150.188.9 with HTTP; Mon, 22 Aug 2011 04:08:46 -0700 (PDT) In-Reply-To: References: Date: Mon, 22 Aug 2011 15:08:46 +0400 Message-ID: From: Sergey Kandaurov To: Tom Vijlbrief Content-Type: multipart/mixed; boundary=000e0cd762ae5266d904ab161afa Cc: FreeBSD Net , freebsd-current@freebsd.org Subject: Re: BETA1 IPv6 crash 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: Mon, 22 Aug 2011 11:08:47 -0000 --000e0cd762ae5266d904ab161afa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 8 August 2011 22:06, Tom Vijlbrief wrote: > 2011/8/7 Sergey Kandaurov : >> On 7 August 2011 17:11, Tom Vijlbrief wrote: >>> I installed BETA1 in a fresh ubuntu 11.04 KVM virtual machine with the >>> new installer. >>> >>> Major issue I noticed was the missing /home. >>> >>> It took me quite some time to get IPv6 working in the guest (a Linux >>> configuration issue), but now that it works >>> BETA1 panics in about 50% of the boot attempts: >>> >>> testbsd dumped core - see /var/crash/vmcore.0 >>> >>> Sun Aug =A07 08:25:28 CEST 2011 >>> >>> FreeBSD testbsd 9.0-BETA1 FreeBSD 9.0-BETA1 #0: Thu Jul 28 16:34:16 >>> UTC 2011 =A0 =A0 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENER= IC >>> i386 >>> >>> panic: _mtx_lock_sleep: recursed on non-recursive mutex if_addr_mtx @ >>> /usr/src/sys/netinet6/mld6.c:1676 >>> >>> GNU gdb 6.1.1 [FreeBSD] >>> Copyright 2004 Free Software Foundation, Inc. >>> GDB is free software, covered by the GNU General Public License, and yo= u are >>> welcome to change it and/or distribute copies of it under certain condi= tions. >>> Type "show copying" to see the conditions. >>> There is absolutely no warranty for GDB. =A0Type "show warranty" for de= tails. >>> This GDB was configured as "i386-marcel-freebsd"... >> [..] >>> panic: _mtx_lock_sleep: recursed on non-recursive mutex if_addr_mtx @ >>> /usr/src/sys/netinet6/mld6.c:1676 >>> >>> cpuid =3D 0 >>> KDB: enter: panic >>> Uptime: 28s >>> Physical memory: 491 MB >>> Dumping 45 MB: 30 14 >>> >>> #0 =A0doadump (textdump=3D1) at pcpu.h:244 >>> 244 =A0 =A0 pcpu.h: No such file or directory. >>> =A0 =A0 =A0 =A0in pcpu.h >>> (kgdb) #0 =A0doadump (textdump=3D1) at pcpu.h:244 >>> #1 =A00xc0a04965 in kern_reboot (howto=3D260) >>> =A0 =A0at /usr/src/sys/kern/kern_shutdown.c:430 >>> #2 =A00xc0a04291 in panic (fmt=3DVariable "fmt" is not available. >>> ) at /usr/src/sys/kern/kern_shutdown.c:595 >>> #3 =A00xc09f4a4a in _mtx_lock_sleep (m=3D0xc35f3a28, tid=3D3278693824, = opts=3D0, >>> =A0 =A0file=3D0xc0f1ab65 "/usr/src/sys/netinet6/mld6.c", line=3D1676) >>> =A0 =A0at /usr/src/sys/kern/kern_mutex.c:341 >>> #4 =A00xc09f4c67 in _mtx_lock_flags (m=3D0xc35f3a28, opts=3D0, >>> =A0 =A0file=3D0xc0f1ab65 "/usr/src/sys/netinet6/mld6.c", line=3D1676) >>> =A0 =A0at /usr/src/sys/kern/kern_mutex.c:203 >>> #5 =A00xc0bbf007 in mld_set_version (mli=3D0xc3589a00, version=3DVariab= le >>> "version" is not available. >>> ) >>> =A0 =A0at /usr/src/sys/netinet6/mld6.c:1676 >>> #6 =A00xc0bc0c00 in mld_input (m=3D0xc3951e00, off=3D48, icmp6len=3D24) >>> =A0 =A0at /usr/src/sys/netinet6/mld6.c:690 >>> #7 =A00xc0ba5696 in icmp6_input (mp=3D0xc3313a54, offp=3D0xc3313a68, pr= oto=3D58) >>> =A0 =A0at /usr/src/sys/netinet6/icmp6.c:654 >>> #8 =A00xc0bba23a in ip6_input (m=3D0xc3951e00) >>> =A0 =A0at /usr/src/sys/netinet6/ip6_input.c:964 >>> #9 =A00xc0ac9b1c in netisr_dispatch_src (proto=3D10, source=3D0, m=3D0x= c3951e00) >>> =A0 =A0at /usr/src/sys/net/netisr.c:1013 >>> #10 0xc0ac9da0 in netisr_dispatch (proto=3D10, m=3D0xc3951e00) >>> =A0 =A0at /usr/src/sys/net/netisr.c:1104 >>> #11 0xc0abecf1 in ether_demux (ifp=3D0xc35f3800, m=3D0xc3951e00) >>> =A0 =A0at /usr/src/sys/net/if_ethersubr.c:936 >>> #12 0xc0abf1b3 in ether_nh_input (m=3D0xc3951e00) >>> =A0 =A0at /usr/src/sys/net/if_ethersubr.c:755 >>> #13 0xc0ac9b1c in netisr_dispatch_src (proto=3D9, source=3D0, m=3D0xc39= 51e00) >>> =A0 =A0at /usr/src/sys/net/netisr.c:1013 >>> #14 0xc0ac9da0 in netisr_dispatch (proto=3D9, m=3D0xc3951e00) >>> =A0 =A0at /usr/src/sys/net/netisr.c:1104 >>> #15 0xc0abe7f5 in ether_input (ifp=3D0xc35f3800, m=3D0xc3951e00) >>> =A0 =A0at /usr/src/sys/net/if_ethersubr.c:796 >>> #16 0xc0672bc9 in lem_handle_rxtx (context=3D0xc3732000, pending=3D1) >>> =A0 =A0at /usr/src/sys/dev/e1000/if_lem.c:3554 >>> #17 0xc0a468ab in taskqueue_run_locked (queue=3D0xc359ca80) >>> =A0 =A0at /usr/src/sys/kern/subr_taskqueue.c:306 >>> #18 0xc0a47307 in taskqueue_thread_loop (arg=3D0xc37365ec) >>> =A0 =A0at /usr/src/sys/kern/subr_taskqueue.c:495 >>> #19 0xc09d7af8 in fork_exit (callout=3D0xc0a472a0 , >>> =A0 =A0arg=3D0xc37365ec, frame=3D0xc3313d28) at /usr/src/sys/kern/kern_= fork.c:941 >>> #20 0xc0d1d714 in fork_trampoline () at /usr/src/sys/i386/i386/exceptio= n.s:275 >>> (kgdb) >>> >> >> This is the same as in PR kern/158426. >> Can you try the patch from PR followup and report us whether it helps? >> Full link to PR with patch: >> http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/158426 >> > > I applied the patch and tried about 15 reboots and all went fine.... > Hi, Tom. A better fix for this problem has been developed since then. Would you please try it as well? For doing that, you need to revert a previous patch and apply this one. Please report if this change also fixes the panic for you, so it has better chances to get into 9.0 release. Index: sys/netinet6/mld6.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet6/mld6.c (revision 224471) +++ sys/netinet6/mld6.c (working copy) @@ -680,7 +680,6 @@ mld_v1_input_query(struct ifnet *ifp, const struct IN6_MULTI_LOCK(); MLD_LOCK(); - IF_ADDR_LOCK(ifp); /* * Switch to MLDv1 host compatibility mode. @@ -693,6 +692,7 @@ mld_v1_input_query(struct ifnet *ifp, const struct if (timer =3D=3D 0) timer =3D 1; + IF_ADDR_LOCK(ifp); if (is_general_query) { /* * For each reporting group joined on this @@ -888,7 +888,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct IN6_MULTI_LOCK(); MLD_LOCK(); - IF_ADDR_LOCK(ifp); mli =3D MLD_IFINFO(ifp); KASSERT(mli !=3D NULL, ("%s: no mld_ifinfo for ifp %p", __func__, i= fp)); @@ -936,14 +935,18 @@ mld_v2_input_query(struct ifnet *ifp, const struct * Queries for groups we are not a member of on this * link are simply ignored. */ + IF_ADDR_LOCK(ifp); inm =3D in6m_lookup_locked(ifp, &mld->mld_addr); - if (inm =3D=3D NULL) + if (inm =3D=3D NULL) { + IF_ADDR_UNLOCK(ifp); goto out_locked; + } if (nsrc > 0) { if (!ratecheck(&inm->in6m_lastgsrtv, &V_mld_gsrdelay)) { CTR1(KTR_MLD, "%s: GS query throttled.", __func__); + IF_ADDR_UNLOCK(ifp); goto out_locked; } } @@ -961,10 +964,10 @@ mld_v2_input_query(struct ifnet *ifp, const struct /* XXX Clear embedded scope ID as userland won't expect it.= */ in6_clearscope(&mld->mld_addr); + IF_ADDR_UNLOCK(ifp); } out_locked: - IF_ADDR_UNLOCK(ifp); MLD_UNLOCK(); IN6_MULTI_UNLOCK(); --=20 wbr, pluknet --000e0cd762ae5266d904ab161afa Content-Type: application/octet-stream; name="mld6.locking.2.patch" Content-Disposition: attachment; filename="mld6.locking.2.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_grncdatp0 SW5kZXg6I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