阅读:3359回复:11
清缓存时CcFlushCache报这个错是啥意思?
BUGCHECK: 8e KERNEL_MODE_EXCEPTION_NOT_HANDLED
A kernel-mode program generated an exception which the error handler did not catch. Parameter 1 : 0xc0000005 Exception code not handle(STATUS_ACCESS_VIOLATION) Parameter 2 : 0x804eeb01 Address of instruction executing (if known) Parameter 3 : 0xf93a6088 Trap Frame Probably caused by : ntoskrnl!CcFlushCache+0x1ee TrapFrame Address : 0xf93a6088 |
|
沙发#
发布于:2007-05-09 18:06
巡例问一下... CcFlushCache之前有使用CcIsFileCached判断一下么???
|
|
板凳#
发布于:2007-05-09 21:03
引用第1楼nvicly于2007-05-09 18:06发表的“”: 没有,只是判断了一下fileObject->SectionObjectPointer是否NULL,我看osr上的人都是这么写的,不过至今我还没清缓成功,请多多指教。 |
|
地板#
发布于:2007-05-10 11:54
1. 问题多半不是出在CcFlushCache身上,估计是和文件系统内部创建的临时FILE_OBJECT有关;
2. 建议对fileObject->SectionObjectPointer进行非空检查; |
|
|
地下室#
发布于:2007-05-10 12:07
引用第3楼devia于2007-05-10 11:54发表的“”: 多谢大哥 啥叫非空检查?是不是就是判断一下是否为NULL? |
|
5楼#
发布于:2007-05-10 12:25
YES
|
|
|
6楼#
发布于:2007-05-10 13:13
嗯,检查了,问题依旧。下面是代码,大侠们帮小弟看看:
void ManageFileCache(PFILE_OBJECT pFileObject) { PFSRTL_COMMON_FCB_HEADER pFcb; LARGE_INTEGER liInterval; //BOOLEAN bNeedReleaseResource = FALSE; //BOOLEAN bNeedReleasePagingIoResource = FALSE; KIRQL irql; BOOLEAN bLockedResource=FALSE; BOOLEAN bLockedPagingIoResource=FALSE; BOOLEAN bReleaseResource=FALSE; BOOLEAN bReleasePagingIoResource=FALSE; pFcb = (PFSRTL_COMMON_FCB_HEADER)pFileObject->FsContext; if(pFcb == NULL) { return; } irql = KeGetCurrentIrql(); if (irql >= DISPATCH_LEVEL) { return; } liInterval.QuadPart = -1 * (LONGLONG)50; //KeEnterCriticalRegion(); bLockedPagingIoResource = ExIsResourceAcquiredExclusiveLite(pFcb->PagingIoResource); bLockedResource=ExIsResourceAcquiredExclusiveLite(pFcb->Resource); if(!bLockedPagingIoResource) bReleasePagingIoResource=TRUE; if(!bLockedResource) bReleaseResource=TRUE; while(!bLockedPagingIoResource || !bLockedResource) { if(!bLockedResource) { if(ExAcquireResourceExclusiveLite(pFcb->Resource, FALSE)==TRUE) bLockedResource=TRUE; else goto clear; } if(!bLockedPagingIoResource) { if(ExAcquireResourceExclusiveLite(pFcb->PagingIoResource, FALSE)==TRUE) bLockedPagingIoResource=TRUE; else goto clear; } if(bLockedPagingIoResource && bLockedResource) break; clear: if (bLockedPagingIoResource) { ExReleaseResourceLite(pFcb->PagingIoResource); bLockedPagingIoResource = FALSE; } if (bLockedResource) { ExReleaseResourceLite(pFcb->Resource); bLockedResource=FALSE; } KeLeaveCriticalRegion(); if (irql == PASSIVE_LEVEL) { KeDelayExecutionThread(KernelMode, FALSE, &liInterval); } else { KEVENT waitEvent; KeInitializeEvent(&waitEvent, NotificationEvent, FALSE); KeWaitForSingleObject(&waitEvent, Executive, KernelMode, FALSE, &liInterval); } KeEnterCriticalRegion(); } //加锁完毕 if (pFileObject->SectionObjectPointer != NULL) { IO_STATUS_BLOCK ioStatus; CcFlushCache(pFileObject->SectionObjectPointer, NULL, 0, &ioStatus); if (pFileObject->SectionObjectPointer->ImageSectionObject != NULL) MmFlushImageSection(pFileObject->SectionObjectPointer, MmFlushForWrite);//MmFlushForDelete if (pFileObject->SectionObjectPointer->DataSectionObject != NULL) CcPurgeCacheSection(pFileObject->SectionObjectPointer , NULL, 0, FALSE); } if (bReleasePagingIoResource) { ExReleaseResourceLite(pFcb->PagingIoResource); bLockedPagingIoResource = FALSE; } if (bReleaseResource) { ExReleaseResourceLite(pFcb->Resource); bLockedResource=FALSE; } KeLeaveCriticalRegion(); } |
|
7楼#
发布于:2007-05-10 13:23
分区格式是FAT32还是NTFS?
|
|
|
8楼#
发布于:2007-05-10 13:38
FAT32
|
|
9楼#
发布于:2007-05-10 13:51
引用第8楼dionysus77于2007-05-10 13:38发表的“”: 这是FAT32文件系统存在的一个很已知BUG,是栈文件(文件系统内部为提高性能而创建的临时文件对象)引起的,osr上有篇文章介绍如何解决,具体地址确实忘记了。 不知道你在NTFS上测试过没有? 根据我的经验在NTFS上应该没问题, 这是因为NTFS是用流来解决FAT32中的临时文件对象的。 |
|
|
10楼#
发布于:2007-05-10 14:03
引用第9楼devia于2007-05-10 13:51发表的“”: 原来如此,老大就是有经验啊!好,俺去osr艘艘看 |
|
11楼#
发布于:2009-06-21 11:17
是 OSR上的哪个文章了,我搜索了很久只找到了一篇 说 此问题是 卡巴斯基的 klif.sys 驱动的bug造成的
网址:http://www.osronline.com/showThread.cfm?link=140590 请问 devia 你所说的是 Fat32 bug的文章再哪里呢? |
|
|