|
From: Hartmut B. <har...@te...> - 2002-05-12 11:51:04
|
Hi, sometimes ros does crash with assertions from MmOpenMemoryAreaByAddress. Normaly this can not occur because the address space is locked at any operation that will manipulate it. This does not work for recursive calls from the same thread, because the lock is a MUTEX. For testing I've it changed to a FAST_MUTEX and do print out the calling functions and the stack trace (KeBugCheck does this) at a recursive call from the same thread. A simple test with 'gcc -o rdel.o rdel.c -c -pipe' crashs ros. The recursive functions are MmUnmapLockedPages and MmMapLockedPages. It seems, that a locked address space also must disable the task switching. For testing, I've added a KeRaiseIrql/KeLowerIrql at each lock/unlock for the kernel address space. This solve the problem. I think we must change the handling for address spaces and memory areas. At many points, where the address space is locked (access and paging faults), there must be locked the memory area from the address space and not the address space itself. All changes within the address space must occur without thread switching (irql raise to DISPATCH_LEVEL). Some functions must be split for a short lock time of address spaces (MmFreeMemoryArea). Any ideas or comments? - Hartmut |