In our file system, we have seen a few instances of the following scenario:
A) Initialize a (PFILE_OBJECT)VirtualVolumeFile shared cache map with
CcInitializeCacheMap().
B) Verify that VirtualVolumeFile->SectionObjectPointer->SharedCacheMap is
non-NULL.
C) After some unknown (long) set of operations, SharedCacheMap is NULL,
resulting in a
page fault when the file system code calls into a Windows routine that
accesses the
SharedCacheMap, such as CcGetActiveVacb().
VirtualVolumeFile->SectionObjectPointer->DataSectionObject is (apparently)
still valid - or at least non-zero.
Clearly, something is happening to zero out the SharedCacheMap; we’re
wondering if it’s a side effect of something we’re doing with the Cache
Manager that we don’t know about.
Where does the Cache Manager (i.e., what CM calls) tear down the cache map
(clearly, CcUnititalizeCacheMap() is one of them, but we’re pretty sure
we’re not calling it during the processing in question, and I believe it
would invalidate the DataSectionObject if it was called)? Is this something
that can only happen as a consequence of us requesting it? Or will the cache
manager take this action during some error processing paths?
It’s entirely possible that we’re whacking the SharedCacheMap pointer
somewhere in our code, but it isn’t likely. This is happening only on x64
machines, FWIW.
This doesn’t happen often enough that the easy ways to debug it (i.e., a
watch point on SharedCacheMap) are very easy to accomplish, so we’re looking
for other obscure paths that might lead us here.
Thanks!..dave