Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Dec 2012 13:49:04 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        Garrett Cooper <yanegomi@gmail.com>, freebsd-net@freebsd.org, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Fatal trap 1
Message-ID:  <20121222114904.GO53644@kib.kiev.ua>
In-Reply-To: <50D59D31.6010302@FreeBSD.org>
References:  <CAGH67wQKUDLQmL8cnWwgzQpWAN2OhKLu0AemPNuy7EOC-i1p9g@mail.gmail.com> <CAJ-Vmo=MsSV3DhAVEP36d%2BFccHDdQz7%2By7v5xTjYKyBP0PfQoQ@mail.gmail.com> <CAMBSHm96ZEiF4mOhUyk-aDS%2BGs%2BhDsh_dMsd-WFcmZ%2BSm6Zk%2BA@mail.gmail.com> <CAGH67wQ8L5R8H7G7s%2B6b%2BiKaAz54es8scnASUQ8Env10x1iqzg@mail.gmail.com> <50D5949A.1060505@FreeBSD.org> <20121222112124.GN53644@kib.kiev.ua> <50D59D31.6010302@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



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