Fatal trap 1

Konstantin Belousov kostikbel at gmail.com
Sat Dec 22 11:49:09 UTC 2012


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 dereferenced
> > 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 vtoslab()
> > result is NULL.
> > 
> > So instead of KASSERT triggering the next line, you see this improvement.
> 
> Interesting.  Thank you for the explanation.
> 
> But looking at the code I think that slabref->us_keg access _before_ KASSERT
> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20121222/dcb5f76c/attachment.sig>


More information about the freebsd-current mailing list