Hi all,
I am getting a PAGE_FAULT_IN_NONPAGED_AREA when trying to run an .exe from
my file system. The application I am trying to run is calc.exe which I
copied to my file system from C:\windows\system32. I am testing with the
checked build of my driver on a checked version of windows xp sp2, using ifs
3790. Driver verifier is enabled for my driver. I fixed all prefast
warnings except those about performance.
Sometimes it works just fine, other times it faults. Most of the time the
error is a PAGE_FAULT_IN_NONPAGED_AREA, but once it was a
DRIVER_PAGE_FAULT_IN_FREED_SPECIAL_POOL, and one other time it was
IRQL_NOT_LESS_OR_EQUAL. However, I think its all pretty much the same
thing. Yes/no?
I am using DbdPrint() to trace things in my driver (using the serial port).
Unfortunately, when I enable tracing, I cannot repro the fault. When I
disable tracing, I can repro the fault easily. So I suspect a timing/race
condition. Would you agree?
However, when I do get a crash and I use '!analyze -v' in the debugger to
get more info, I don't see anything that gives me any clues. Most of the
analyze outputs look like the ones at the bottom of this email. The memory
being referenced is not something that I recognize, the faulting IP is not
in my driver. In fact, its almost always in NtGdiXXX.
If anyone has any ideas or tips on how I could proceed to debug this, it
would be greatly appreciated. Thanks.
kd> !analyze -v
****************************************************************************
***
*
*
* Bugcheck Analysis
*
*
*
****************************************************************************
***
PAGE_FAULT_IN_NONPAGED_AREA (50)
Invalid system memory was referenced. This cannot be protected by
try-except,
it must be protected by a Probe. Typically the address is just plain bad or
it
is pointing at freed memory.
Arguments:
Arg1: ffff0901, memory referenced.
Arg2: 00000001, value 0 = read operation, 1 = write operation.
Arg3: bf830ae7, If non-zero, the instruction address which referenced the
bad memory address.
Arg4: 00000000, (reserved)
Debugging Details:
WRITE_ADDRESS: ffff0901
FAULTING_IP:
win32k!NtGdiExtTextOutW+33f
bf830ae7 ff83bd08ffff inc dword ptr [ebx-0xf743]
MM_INTERNAL_CODE: 0
IMAGE_NAME: hardware
DEBUG_FLR_IMAGE_TIMESTAMP: 0
FAULTING_MODULE: bf800000 win32k
DEFAULT_BUCKET_ID: DRIVER_FAULT
BUGCHECK_STR: 0x50
LAST_CONTROL_TRANSFER: from ad5a48f2 to bf830ae7
MISALIGNED_IP:
win32k!NtGdiExtTextOutW+33f
bf830ae7 ff83bd08ffff inc dword ptr [ebx-0xf743]
TRAP_FRAME: f2fed608 -- (.trap fffffffff2fed608)
ErrCode = 00000002
eax=00000001 ebx=00000044 ecx=855a96fc edx=00000000 esi=0007f4aa
edi=f2fed70a
eip=bf830ae7 esp=f2fed67c ebp=f2fed79b iopl=0 nv up ei ng nz ac po
nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
efl=00010296
win32k!NtGdiExtTextOutW+0x33f:
bf830ae7 ff83bd08ffff inc dword ptr [ebx-0xf743]
ds:0023:ffff0901=????????
Resetting default scope
STACK_TEXT:
f2fed79b ad5a48f2 01051d80 00001037 00000100 win32k!NtGdiExtTextOutW+0x33f
WARNING: Frame IP not in any known module. Following frames may be wrong.
f2fed7c3 ad59bd00 00000080 00010000 07f42000 0xad5a48f2
00000000 00000000 00000000 00000000 00000000 0xad59bd00
FOLLOWUP_IP:
win32k!NtGdiExtTextOutW+33f
bf830ae7 ff83bd08ffff inc dword ptr [ebx-0xf743]
SYMBOL_STACK_INDEX: 0
FOLLOWUP_NAME: MachineOwner
SYMBOL_NAME: win32k!NtGdiExtTextOutW+33f
STACK_COMMAND: .trap fffffffff2fed608 ; kb
MODULE_NAME: hardware
FAILURE_BUCKET_ID: IP_MISALIGNED
BUCKET_ID: IP_MISALIGNED
Followup: MachineOwner
kd> !analyze -v
****************************************************************************
***
*
*
* Bugcheck Analysis
*
*
*
****************************************************************************
***
PAGE_FAULT_IN_NONPAGED_AREA (50)
Invalid system memory was referenced. This cannot be protected by
try-except,
it must be protected by a Probe. Typically the address is just plain bad or
it
is pointing at freed memory.
Arguments:
Arg1: 85f008f9, memory referenced.
Arg2: 00000000, value 0 = read operation, 1 = write operation.
Arg3: bf943776, If non-zero, the instruction address which referenced the
bad memory
address.
Arg4: 00000000, (reserved)
Debugging Details:
READ_ADDRESS: 85f008f9
FAULTING_IP:
win32k!EXLATEOBJ::bInitXlateObj+b0
bf943776 8b4818 mov ecx,[eax+0x18]
MM_INTERNAL_CODE: 0
IMAGE_NAME: win32k.sys
DEBUG_FLR_IMAGE_TIMESTAMP: 41108c9f
MODULE_NAME: win32k
FAULTING_MODULE: bf800000 win32k
DEFAULT_BUCKET_ID: DRIVER_FAULT
BUGCHECK_STR: 0x50
LAST_CONTROL_TRANSFER: from bf93673d to bf943776
TRAP_FRAME: f2d714bc -- (.trap fffffffff2d714bc)
ErrCode = 00000000
eax=85f008e1 ebx=00000000 ecx=f2d71664 edx=00000024 esi=e15a4248
edi=e185f007
eip=bf943776 esp=f2d71530 ebp=f2d71540 iopl=0 nv up ei ng nz ac pe
cy
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
efl=00010293
win32k!EXLATEOBJ::bInitXlateObj+0xb0:
bf943776 8b4818 mov ecx,[eax+0x18]
ds:0023:85f008f9=????????
Resetting default scope
STACK_TEXT:
f2d71540 bf93673d 00000000 00000000 e185f007
win32k!EXLATEOBJ::bInitXlateObj+0xb0
f2d7166c bf948a88 3301050f 00000000 00000000 win32k!GreDrawStream+0x474
f2d717b4 80ad5a48 3301050f 00000060 0007f670 win32k!NtGdiDrawStream+0xb2
f2d717b4 7c834684 3301050f 00000060 0007f670 nt!KiFastCallEntry+0x158
0007f4dc 77f99126 77f8659e 3301050f 00000060 ntdll!KiFastSystemCallRet
0007f5ec 56aa5439 3301050f 00000060 0007f670 GDI32!NtGdiDrawStream+0xc
0007f868 56aa5d70 00b42e68 00b423e4 00000001
UxTheme!CImageFile::DrawBackgroundDS+0x3a0
0007f8e0 56aa60b7 00b42e68 00035fd8 3301050f
UxTheme!CImageFile::DrawImageInfo+0x1eb
0007f930 56abbd0e 00035fd8 3301050f 00000001
UxTheme!CImageFile::DrawBackground+0x45
0007f990 77295252 00b42e64 3301050f 00000001
UxTheme!DrawThemeBackground+0x137
0007fa88 77295706 000ae208 3301050f 00000001
comctl32!Button_DrawThemed+0x176
0007fb04 77295c5c 00000001 3301050f 00000001 comctl32!Button_DrawPush+0x59
0007fb80 77295f82 00000001 3301050f 0007fc78 comctl32!Button_Paint+0x2f9
0007fc10 77d13df0 000201a4 0000000f 00000000 comctl32!Button_WndProc+0x270
0007fc3c 77d1efeb 77295d12 000201a4 0000000f USER32!InternalCallWinProc+0x28
0007fca4 77ce96ef 00000000 77295d12 000201a4
USER32!UserCallWinProcCheckWow+0x150
0007fcf8 77ce9920 006ca958 0000000f 00000000
USER32!DispatchClientMessage+0x126
0007fd20 7c8345e3 0007fd30 00000018 006ca958 USER32!__fnDWORD+0x24
0007fd20 80a3c6f4 0007fd30 00000018 006ca958
ntdll!KiUserCallbackDispatcher+0x13
f2d71a94 80b7529e f2d71b60 f2d71b58 7ffdf6f4 nt!KiCallUserMode+0x4
f2d71af0 bf806d03 00000002 f2d71b40 00000018 nt!KeUserModeCallback+0xc8
f2d71b8c bf8f94cf be2ba958 0000000f 00000000 win32k!SfnDWORD+0x114
f2d71be4 bf8035a7 422ba958 0000000f 00000000
win32k!xxxSendMessageToClient+0x153
f2d71c34 bf80ddcd be2ba958 0000000f 00000000
win32k!xxxSendMessageTimeout+0x1f1
f2d71c58 bf80a477 be2ba958 0000000f 00000000 win32k!xxxSendMessage+0x1b
f2d71c94 bf80a51a be2ba958 00000005 be2b9570 win32k!xxxUpdateWindow2+0x83
f2d71cc8 bf80a5d1 be2b9570 00000001 0000124b win32k!xxxUpdateWindow2+0x126
f2d71d00 bf80a54c be2b9570 00000001 f2d71d48
win32k!xxxInternalUpdateWindow+0x79
f2d71d10 bf80a6cf be2b9570 f2d71d58 0007fd58 win32k!xxxUpdateWindow+0x17
f2d71d48 80ad5a48 be2b9570 0000005e 80ad59bd win32k!NtUserCallHwndLock+0xf2
f2d71d48 7c834684 be2b9570 0000005e 80ad59bd nt!KiFastCallEntry+0x158
0007fd20 7c8345e3 0007fd30 00000018 006ca958 ntdll!KiFastSystemCallRet
0007fd44 77cea0aa 77cea00e 000500f8 0000005e
ntdll!KiUserCallbackDispatcher+0x13
0007fd58 77d1b83a 000500f8 00000000 00000130 USER32!NtUserCallHwndLock+0xc
0007fd70 010024c4 000500f8 01015018 77e6a338
USER32!UpdateWindow_wrapper+0x3e
0007fe08 010027c7 0000007a 77e78bf7 000a2ea6 calc!InitSciCalc+0x414
0007ff1c 01013152 000aab90 00000055 000aab90 calc!WinMain+0x1dd
0007ffc0 77e821ce 7cb3e3a6 00000000 7ffd4000 calc!WinMainCRTStartup+0x174
0007fff0 00000000 01012fde 00000000 78746341 kernel32!BaseProcessStart+0x23
FOLLOWUP_IP:
win32k!EXLATEOBJ::bInitXlateObj+b0
bf943776 8b4818 mov ecx,[eax+0x18]
SYMBOL_STACK_INDEX: 0
FOLLOWUP_NAME: MachineOwner
SYMBOL_NAME: win32k!EXLATEOBJ::bInitXlateObj+b0
STACK_COMMAND: .trap fffffffff2d714bc ; kb
FAILURE_BUCKET_ID: 0x50_win32k!EXLATEOBJ::bInitXlateObj+b0
BUCKET_ID: 0x50_win32k!EXLATEOBJ::bInitXlateObj+b0
Followup: MachineOwner
=================================================
Roger Tawa
http://tawacentral.net/
[One thing about paradigms: shift happens.]
[When you stop, you're done.]