From owner-freebsd-current@freebsd.org Wed Apr 12 14:03:18 2017 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 2E821D3BCE1 for ; Wed, 12 Apr 2017 14:03:18 +0000 (UTC) (envelope-from peter.blok@bsd4all.org) Received: from smtpq1.tb.mail.iss.as9143.net (smtpq1.tb.mail.iss.as9143.net [212.54.42.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDC9BA84 for ; Wed, 12 Apr 2017 14:03:17 +0000 (UTC) (envelope-from peter.blok@bsd4all.org) Received: from [212.54.34.117] (helo=smtp9.mnd.mail.iss.as9143.net) by smtpq1.tb.mail.iss.as9143.net with esmtp (Exim 4.86_2) (envelope-from ) id 1cyIrT-0001Na-U4; Wed, 12 Apr 2017 16:03:07 +0200 Received: from 5ed15678.cm-7-2b.dynamic.ziggo.nl ([94.209.86.120] helo=wan0.bsd4all.org) by smtp9.mnd.mail.iss.as9143.net with esmtp (Exim 4.86_2) (envelope-from ) id 1cyIrT-0001o4-RR; Wed, 12 Apr 2017 16:03:07 +0200 Received: from newnas (localhost [127.0.0.1]) by wan0.bsd4all.org (Postfix) with ESMTP id 4B2277352; Wed, 12 Apr 2017 16:03:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at bsd4all.org Received: from wan0.bsd4all.org ([127.0.0.1]) by newnas (newnas.bsd4all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YkHOLd3saLVj; Wed, 12 Apr 2017 16:03:06 +0200 (CEST) Received: from [192.168.1.64] (mm [192.168.1.64]) by wan0.bsd4all.org (Postfix) with ESMTPSA id D768E734A; Wed, 12 Apr 2017 16:03:05 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: panic with jail bug_id 213673 was: VNET branch destiny From: peter.blok@bsd4all.org In-Reply-To: <85718A56-E6B1-461F-A2BA-915B1AE43D06@bsd4all.org> Date: Wed, 12 Apr 2017 16:03:05 +0200 Cc: Pavel Timofeev , "Bjoern A. Zeeb" , freebsd-current , ari@stonepile.fi Content-Transfer-Encoding: quoted-printable Message-Id: <1B59D667-DF9E-4F68-A024-FC96FAFEE747@bsd4all.org> References: <0136F3BE-4B47-4677-8D81-3FE0F5E67E79@lists.zabbadoz.net> <24B3E322-5B92-470D-A1D6-10DF8EF79490@bsd4all.org> <7B9879DE-7500-47CB-8471-38E2B899C324@sigsegv.be> <85718A56-E6B1-461F-A2BA-915B1AE43D06@bsd4all.org> To: Kristof Provost X-Mailer: Apple Mail (2.3273) X-SourceIP: 94.209.86.120 X-Ziggo-spambar: / X-Ziggo-spamscore: 0.0 X-Ziggo-spamreport: CMAE Analysis: v=2.2 cv=ZpSdE5zG c=1 sm=1 tr=0 a=IkzOOneQUJP1+bAPekPvBg==:17 a=IkcTkHD0fZMA:10 a=AzvcPWV-tVgA:10 a=6Q3WNqvRAAAA:8 a=6I5d2MoRAAAA:8 a=l_XCJ1vjxRHGdAvyGXcA:9 a=4gPl2zFEiwZUWhjw:21 a=zPDBYn9PRV8jXRl9:21 a=QEXdDO2ut3YA:10 a=I8PBwKCn76L9oNdl0isp:22 a=IjZwj45LgO3ly-622nXo:22 none X-Ziggo-Spam-Status: No X-Spam-Status: No X-Spam-Flag: No 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: Wed, 12 Apr 2017 14:03:18 -0000 The problem happens when stopping a jail. It doesn=E2=80=99t seem to be = related to vnet at all. When stopping a jail, pfr_cleanup calls uma_zdestroy(V_pfr_kentry_z). = The dtor calls zone_release, which calls slab_free_item. The issue seems = to be that the keg found in zone_release does not belong to the zone = that is to be destroyed, but belongs to the zone that is created for the = same purpose at the host. The zone belongs to the jail (verified). The = added if (marked with XXX) fixes the problem. I don=E2=80=99t understand how a keg ends up in a different zone. zone_release(uma_zone_t zone, void **bucket, int cnt) { void *item; uma_slab_t slab; uma_keg_t keg; uint8_t *mem; int clearfull; int i; =20 clearfull =3D 0; keg =3D zone_first_keg(zone); KEG_LOCK(keg); for (i =3D 0; i < cnt; i++) { item =3D bucket[i]; if (!(zone->uz_flags & UMA_ZONE_VTOSLAB)) { mem =3D (uint8_t *)((uintptr_t)item & = (~UMA_SLAB_MASK)); if (zone->uz_flags & UMA_ZONE_HASH) { slab =3D hash_sfind(&keg->uk_hash, mem); } else { mem +=3D keg->uk_pgoff; slab =3D (uma_slab_t)mem; } } else { slab =3D vtoslab((vm_offset_t)item); if (slab->us_keg !=3D keg) { KEG_UNLOCK(keg); keg =3D slab->us_keg; KEG_LOCK(keg); } } if (keg =3D=3D slab->us_keg) = // XXX seems to fix the problem slab_free_item(keg, slab, item); > On 11 Apr 2017, at 13:43, peter.blok@bsd4all.org wrote: >=20 > Hi Kristof, >=20 > I=E2=80=99m prety sure it is the same as = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213673 = . It is = unrelated to epair or ng_eiface (my case). >=20 > I=E2=80=99ll dig some more. >=20 > Peter >=20 >=20 >> On 11 Apr 2017, at 08:47, Kristof Provost wrote: >>=20 >> On 10 Apr 2017, at 12:10, peter.blok@bsd4all.org wrote: >>> There have been issues with pf if I recall correctly. I currently = have issues with stable, pf and vnet. There is an issue with pf table = entries when an interface is moved to a different vnet. >>>=20 >>> Does anyone no if there is a specific fix for this that hasn=E2=80=99t= been ported to stable? I haven=E2=80=99t had the time to test this on = current. >>>=20 >> I=E2=80=99m currently aware of at least some issues with pf and vnet, = even in CURRENT. >> Not that one though, so can you make sure there=E2=80=99s a bug = report with as much detail as possible? >> Please also cc me (kp@freebsd.org) on the report. >>=20 >> Thanks, >> Kristof >=20 > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org"