Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2020 11:31:53 +0200
From:      Marko Zec <zec@fer.hr>
To:        John-Mark Gurney <jmg@funkthat.com>
Cc:        freebsd-net@freebsd.org, freebsd-current@freebsd.org
Subject:   Re: somewhat reproducable vimage panic
Message-ID:  <20200721113153.42d83119@x23>
In-Reply-To: <20200721091654.GC4213@funkthat.com>
References:  <20200721091654.GC4213@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--MP_/YcpTgPso.vPHN47rj82525a
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tue, 21 Jul 2020 02:16:55 -0700
John-Mark Gurney <jmg@funkthat.com> wrote:

> I'm running:
> FreeBSD test 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r362596: Thu Jun 25
> 05:02:51 UTC 2020
> root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
>  amd64
> 
> and I'm working on improve the if_ure driver.  I've put together a
> little script that I've attached that I'm using to test the driver..
> It puts a couple ue interfaces each into their own jail, configures
> them, and tries to pass traffic.  This assumes that the two interfaces
> are connected together.
> 
> Pretty regularly when destroying the jails, I get the following
> panic: CURVNET_SET at /usr/src/sys/netinet/in_mcast.c:626
> inm_release() curvnet=0 vnet=0xfffff80154c82a80

Perhaps the attached patch could help? (disclaimer: not even
compile-tested)

Marko


> (kgdb) #0  __curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55
> #1  doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:394
> #2  0xffffffff80bc6250 in kern_reboot (howto=260)
>     at /usr/src/sys/kern/kern_shutdown.c:481
> #3  0xffffffff80bc66aa in vpanic (fmt=<optimized out>, ap=<optimized
> out>) at /usr/src/sys/kern/kern_shutdown.c:913
> #4  0xffffffff80bc6403 in panic (fmt=<unavailable>)
>     at /usr/src/sys/kern/kern_shutdown.c:839
> #5  0xffffffff80d6553b in inm_release (inm=0xfffff80029043700)
>     at /usr/src/sys/netinet/in_mcast.c:630
> #6  inm_release_task (arg=<optimized out>, pending=<optimized out>)
>     at /usr/src/sys/netinet/in_mcast.c:312
> #7  0xffffffff80c2521a in taskqueue_run_locked
> (queue=0xfffff80003116b00) at /usr/src/sys/kern/subr_taskqueue.c:476
> #8  0xffffffff80c26294 in taskqueue_thread_loop (arg=<optimized out>)
>     at /usr/src/sys/kern/subr_taskqueue.c:793
> #9  0xffffffff80b830f0 in fork_exit (
>     callout=0xffffffff80c26200 <taskqueue_thread_loop>, 
>     arg=0xffffffff81cf4f70 <taskqueue_thread>,
> frame=0xfffffe0049e99b80) at /usr/src/sys/kern/kern_fork.c:1052
> #10 <signal handler called>
> (kgdb) 
> 
> I have the core files so I can get additional information.
> 
> Let me know if you need any additional information.
> 


--MP_/YcpTgPso.vPHN47rj82525a
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=in_mcast.diff

Index: sys/netinet/in_mcast.c
===================================================================
--- sys/netinet/in_mcast.c	(revision 363386)
+++ sys/netinet/in_mcast.c	(working copy)
@@ -309,8 +309,10 @@
 	IN_MULTI_LOCK();
 	SLIST_FOREACH_SAFE(inm, &inm_free_tmp, inm_nrele, tinm) {
 		SLIST_REMOVE_HEAD(&inm_free_tmp, inm_nrele);
+		CURVNET_SET(inm->inm_ifp->if_vnet);
 		MPASS(inm);
 		inm_release(inm);
+		CURVNET_RESTORE();
 	}
 	IN_MULTI_UNLOCK();
 }

--MP_/YcpTgPso.vPHN47rj82525a--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200721113153.42d83119>