Bug 214629 - [zfs] [panic] solaris assert: pp != NULL && !pp-valid, file: /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, line: 430
Summary: [zfs] [panic] solaris assert: pp != NULL && !pp-valid, file: /usr/src/sys/cdd...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-18 15:49 UTC by Shirkdog
Modified: 2017-05-29 06:29 UTC (History)
4 users (show)

See Also:


Attachments
panic when running pkg update -f on fresh FreeBSD install (603.91 KB, image/jpeg)
2016-11-18 15:49 UTC, Shirkdog
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shirkdog 2016-11-18 15:49:23 UTC
Created attachment 177144 [details]
panic when running pkg update -f on fresh FreeBSD install

Tested on FreeBSD 12 CURRENT SNAPSHOT build 11/17/2016

I thought at first it was an issue with USB Keys, but I isolated this down to the follow requirements to reproduce:

FreeBSD-12 CURRENT build r308737
GELI Encrypted ZFS on ROOT


Once logged in, running the following will panic the box:

pkg update -f


I have attached the screenshot (was unable to get the text output), but the panic is the following:

panic: solaris assert: pp != NULL && !pp-valid, file: /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, line: 430

In looking at a recent code change, it looks like a conditional check for pp==NULL was removed on 2016-11-15, so it appears pp==NULL and pp->valid is not defined.
Comment 1 Andriy Gapon freebsd_committer freebsd_triage 2016-11-18 17:02:32 UTC
(In reply to Shirkdog from comment #0)
You are absolutely correct.
Now that 'else if (pp == NULL)' block has been removed (and we no longer fabricate a cached page), the code should look like:
...
else if (pp != NULL) {
  ASSERT(!pp->valid);
  pp = NULL;
}
Comment 2 Alan Cox freebsd_committer freebsd_triage 2016-11-18 17:10:30 UTC
Yes, I agree.  Sorry about that.  Andriy, are you going to commit the change?
Comment 3 Shawn Webb 2016-11-18 20:42:04 UTC
I hit this bug, too. The candidate patch fixed it.
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-11-19 08:13:31 UTC
A commit references this bug:

Author: avg
Date: Sat Nov 19 08:12:57 UTC 2016
New revision: 308826
URL: https://svnweb.freebsd.org/changeset/base/308826

Log:
  zfs: fix up after the removal of PG_CACHED pages in r308691

  PR:		214629
  Reported by:	mshirk@daemon-security.com
  Reviewed by:	alc
  Tested by:	Shawn Webb <shawn.webb@hardenedbsd.org>
  X-MFC with:	308691

Changes:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Comment 5 Andriy Gapon freebsd_committer freebsd_triage 2016-11-19 08:19:46 UTC
(In reply to Alan Cox from comment #2)
Done.
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-05-29 06:29:46 UTC
A commit references this bug:

Author: avg
Date: Mon May 29 06:15:07 UTC 2017
New revision: 319091
URL: https://svnweb.freebsd.org/changeset/base/319091

Log:
  MFC r308826: zfs: fix up after the removal of PG_CACHED pages in r308691

  Now that r308691 has been MFC-ed as a part of r318716,
  r308826 must be MFC-ed as well.

  PR:		214629
  Reported by:	mshirk@daemon-security.com [head], lev [stable/11]

Changes:
_U  stable/11/
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c