Using NuMega SoftICE

Two ways to cause "page fault" situations, and how SoftICE reports it.

When Windows NT reports "Access violation", it is saying that the processor detected a page fault condition. Windows NT does not use the term "page fault" in order to "abstract" the concept (so that it support other processors).

A "page fault" is a situation where the processor's "page-level protection mechanism" detected a fault. The processor uses its "paging mechanism" for "linear address" to "physical address" convertion, and it performs "protection check" during the conversion.

A "page fault" could be a normal part of "virtual memory" mechanism that Windows implement. For instance, if certain pages are not used often, then it could be "swapped" out to a disk-based "page file". Next time a program try to access it, the processor detect a page fault, which is appropriately handled by Windows' built-in "page fault handler". It is a kind of page fault which is perfectly normal and happens all of the time.

A "page fault" become fatal only when a program access a page that is never being backed by a physical storage (neigher memory nor swapped disk-based page). It is simply accessing "nowhere".

In general, you can cause a page fault either by trying to read data from a memory location or by trying to execute at a memory location. In both cases, if no physical page is assigned, Windows page fault handlers says "I don't know what to do with this...". What happens next is that you will see the familar "Program Error" dialog box reporting ACCESS_VIOLATION.

SoftICE traps this before the default "Program Error" dialog box popps up. If the processor is equipped with MSR (model specific register) - Pentium Pro has it - then SoftICE also prints the contents of MSR as well.

The following figure shows how page faults caused by both "memory access" and "memory execution" are trapped by SoftICE, and how its outputs relate to actual program behaviors.

Real-life page fault is not this simple, but at least you see how SoftICE output try to give clues.


 contact guestbook | control panel 
1998-2000 Tsuyoshi Watanabe. All rights reserved.