From owner-freebsd-current@FreeBSD.ORG Sun Jul 21 07:18:54 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 555A7A00 for ; Sun, 21 Jul 2013 07:18:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id DBAB0812 for ; Sun, 21 Jul 2013 07:18:53 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r6L7IhPV002544; Sun, 21 Jul 2013 10:18:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r6L7IhPV002544 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r6L7IgVf002543; Sun, 21 Jul 2013 10:18:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 21 Jul 2013 10:18:42 +0300 From: Konstantin Belousov To: Oliver Pinter Subject: Re: Panic when starting X with Intel KMS Message-ID: <20130721071842.GZ5991@kib.kiev.ua> References: <51E6EB0A.2060407@entel.upc.edu> <51EA5166.4020508@entel.upc.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V1B6tgkYnQOXc079" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: Gustau P?rez i Querol , freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 21 Jul 2013 07:18:54 -0000 --V1B6tgkYnQOXc079 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 20, 2013 at 01:20:56PM +0200, Oliver Pinter wrote: > On 7/20/13, Gustau P?rez i Querol wrote: > > Reading the backtrace I see this: > > > > panic: pmap_release: pmap resident count -398580 !=3D 0 > > > > which comes from amd64/amd64/pmap.c:1936. I suspect that > > pmap->pm_stats.resident_count being negative is a bug. The issue happened somewhere before the process exit. Try the patch below, the idea is that your overflow count is really big, so the wrong-doer could cause underflow when acting. diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 19be4e0..fcdc6af 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -465,6 +465,9 @@ pmap_resident_count_dec(pmap_t pmap, int count) { =20 PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(pmap->pm_stats.resident_count >=3D count, + ("pmap %p resident count underflow %ld %d", pmap, + pmap->pm_stats.resident_count, count)); pmap->pm_stats.resident_count -=3D count; } =20 --V1B6tgkYnQOXc079 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJR64tRAAoJEJDCuSvBvK1BX8IQAJQyhTy9XCMNw1Gvio80YJ5c /B+Y1TGVSQ8n2rOuZFqdqYFYzFhxglimvZIWLn1gOu2n30rHciRYlffP6fqxUkG/ ZoNPtsFyvzBruuUEZgttRECJ0m7zi0y9PAIpFqYc3jSPHp/xfrjulj13YKSG3p0M oz1c1PRMg7cJLdVSBhdL2cVlTjLFhiwTU2Clo+XNeAuWyALIxpoT8q+6a/SM7U/u SLT804ROjQ+lbABaiPMpBR5X6VxcG5yuMb4kFvLcI8WrK97Pj1ZgOulbixSwKYZe 98EY0EDRAHxa3Gk716vEblsm0CLqXYrk5JxhYmDSacMiEJnzt/DIBuQAAUGDmqam LnYO/ygj9rkvX5HLvZUPTvv9E4qQFMvyflrgXv5beBa7dwrHhSs7f/k0F8LcxF5+ XlvSbHJ5ozWqCwV2v4/wj6JNJYPdA/w0k01kP+7BabiSr/14swkXGr5fH91OrgDq EQbHme23oWeSS3niqiinlgnRWkrI3oG97ra8+Nx6NZntABxO+xWdS1MklrTmXEKQ 0WR+Au2w3GluSg54gshDFFxHCZWnG1T0u7kQ6NplmTcBnLzhD9lI8Q351vSX/KeR 0vA+M4eBEvjLQFmKRE/EQkjwdBjJ+roMXImvwLMhiLyJz6zK7ehH12zRpMMOkR9y SY7+b2tkyd9KwwGXp8Wt =rlWz -----END PGP SIGNATURE----- --V1B6tgkYnQOXc079--