From owner-freebsd-net@FreeBSD.ORG Sat Dec 22 11:49:09 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6DE8BEB; Sat, 22 Dec 2012 11:49:09 +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 15E9D8FC0C; Sat, 22 Dec 2012 11:49:08 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBMBn5wm058431; Sat, 22 Dec 2012 13:49:05 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.3 kib.kiev.ua qBMBn5wm058431 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBMBn4Ba058430; Sat, 22 Dec 2012 13:49:05 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 22 Dec 2012 13:49:04 +0200 From: Konstantin Belousov To: Andriy Gapon Subject: Re: Fatal trap 1 Message-ID: <20121222114904.GO53644@kib.kiev.ua> References: <50D5949A.1060505@FreeBSD.org> <20121222112124.GN53644@kib.kiev.ua> <50D59D31.6010302@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hOh8F6DNH/RZBSFD" Content-Disposition: inline In-Reply-To: <50D59D31.6010302@FreeBSD.org> 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: Garrett Cooper , freebsd-net@freebsd.org, FreeBSD Current X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2012 11:49:09 -0000 --hOh8F6DNH/RZBSFD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 22, 2012 at 01:44:49PM +0200, Andriy Gapon wrote: > on 22/12/2012 13:21 Konstantin Belousov said the following: > > This is due to the vtoslab() returning NULL. Since slabref is dereferen= ced > > later, clang tries to be helpful as usual and converts the !(p->flags & > > PG_SLAB) case from vtoslab() into the jump to un2 instruction if vtosla= b() > > result is NULL. > >=20 > > So instead of KASSERT triggering the next line, you see this improvemen= t. >=20 > Interesting. Thank you for the explanation. >=20 > But looking at the code I think that slabref->us_keg access _before_ KASS= ERT > is the culprit? I.e. even with GCC we could get a page fault before the > KASSERT is reached (modulo reordering)? May be, but I do not think it is matter. Because KASSERT() now can return, even if you reorder the assert and deref, I think that compiler authors still find an excuse. --hOh8F6DNH/RZBSFD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDVnjAACgkQC3+MBN1Mb4gW7wCgn9j92ij2YpljHo9NIj6IneHW 0pAAn1POvHv9NRfsLFExGGFpWzEmkN2a =vH3G -----END PGP SIGNATURE----- --hOh8F6DNH/RZBSFD--