Bugcheck when uninstalling

I get a bugcheck when uninstalling the driver. This is a statistical phenomenon that happens once in several hundreds un-installs.
I get the following dump:
STACK_TEXT:
8a01f3e4 828e36d5 00000003 6083dcd2 00000065 nt!RtlpBreakWithStatusInstruction
8a01f434 828e41d1 00000003 83fdb020 855e8988 nt!KiBugCheckDebugBreak+0x1c
8a01f7f8 828e3574 00000093 000008ec 00000000 nt!KeBugCheck2+0x68b
8a01f81c 82a2ae50 00000093 000008ec 00000000 nt!KeBugCheckEx+0x1e
8a01f870 82a55dd9 88c01cb0 94de31d8 83f2f480 nt!ObpCloseHandleTableEntry+0x1b2
8a01f8a0 82a55f7f 83f2f480 00000000 8a01f944 nt!ObpCloseHandle+0x7f
8a01f8bc 8284779a 800008ec 8a01f950 828450f9 nt!NtClose+0x4e
8a01f8bc 828450f9 800008ec 8a01f950 828450f9 nt!KiFastCallEntry+0x12a
8a01f938 871e47fc 800008ec 85a28378 871e4906 nt!ZwClose+0x11
8a01f944 871e4906 85a28378 8a01f970 871a3f8e Wdf01000!FxRegKey::~FxRegKey+0x19
8a01f950 871a3f8e 00000001 871e281b 00000000 Wdf01000!FxRegKey::`scalar deleting destructor’+0xd
8a01f958 871e281b 00000000 00000000 00000000 Wdf01000!FxObject::SelfDestruct+0xb
8a01f970 871a3fd6 85a28378 85a2838c 8a01f99c Wdf01000!FxObject::ProcessDestroy+0xa6
8a01f980 871e2951 00000000 000004b1 871fb5a8 Wdf01000!FxObject::Release+0x42
8a01f99c 871e2aaa 85a28300 00000001 8416e950 Wdf01000!FxObject::DeletedAndDisposedWorkerLocked+0xb2
8a01f9bc 871e293a 8416e96c 8416e950 8a01f9e0 Wdf01000!FxObject::ParentDeleteEvent+0x83
8a01f9cc 871e3198 8416e900 00000000 8416e950 Wdf01000!FxObject::DeletedAndDisposedWorkerLocked+0x9b
8a01f9e0 871e331d 8416e900 00000001 8410fcc8 Wdf01000!FxObject::DeleteWorkerAndUnlock+0xb8
8a01fa00 871cb67f 8a01fb90 84104308 8a01fa1c Wdf01000!FxObject::DeleteObject+0x179
8a01fa10 92f78259 84104308 8a01fb74 82ac1e25 Wdf01000!FxDriver::Unload+0x62
8a01fa1c 82ac1e25 84104308 6083d392 96dd6bb8 vjoy!FxStubDriverUnload+0x1a [d:\vistartm\drivers\wdf\kmdf\src\dynamic\stub\stub.cpp @ 153]
8a01fb74 829cce30 00000001 84234b98 9223f1c8 nt!IopUnloadDriver+0x338
8a01fb98 828e0a27 94dacc18 84234b98 00000001 nt!PnpUnloadAttachedDriver+0x73
8a01fbbc 82ac4af7 00000015 94dacc18 00000000 nt!PnpRemoveLockedDeviceNode+0x1e1
8a01fbd0 82ac4dab 00000002 00000015 00000000 nt!PnpDeleteLockedDeviceNode+0x2d
8a01fc04 82ac8789 841e2b08 94dacc18 00000002 nt!PnpDeleteLockedDeviceNodes+0x4c
8a01fcc4 829c3bae 8a01fcf4 00000000 982104e8 nt!PnpProcessQueryRemoveAndEject+0x946
8a01fcdc 829bdfb7 00000000 85670d50 83fdb020 nt!PnpProcessTargetDeviceEvent+0x38
8a01fd00 8286d043 85670d50 00000000 83fdb020 nt!PnpDeviceEventWorker+0x216
8a01fd50 829f9d16 00000001 6083d576 00000000 nt!ExpWorkerThread+0x10d
8a01fd90 8289b159 8286cf36 00000001 00000000 nt!PspSystemThreadStartup+0x9e
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x19

You might guess that my driver is vjoy, but there is no such function as FxStubDriverUnload in my code. Is it a callback? How do I locate the error in my code?

xxxxx@gmail.com wrote:

I get a bugcheck when uninstalling the driver. This is a statistical phenomenon that happens once in several hundreds un-installs.

8a01fa1c 82ac1e25 84104308 6083d392 96dd6bb8 vjoy!FxStubDriverUnload+0x1a [d:\vistartm\drivers\wdf\kmdf\src\dynamic\stub\stub.cpp @ 153]
8a01fb74 829cce30 00000001 84234b98 9223f1c8 nt!IopUnloadDriver+0x338
8a01fb98 828e0a27 94dacc18 84234b98 00000001 nt!PnpUnloadAttachedDriver+0x73

You might guess that my driver is vjoy, but there is no such function as FxStubDriverUnload in my code. Is it a callback? How do I locate the error in my code?

It’s part of WDF. The “Fx” stands for “framework”. The implication
here is that the framework was trying to close a registry key, but the
key handle was not valid. Do you use registry keys in your driver?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Looks like someone closed a handle behind kmdf’s back. I would look at your code to see where you close handles and perhaps close an already closed (and thus now invalid ) handle.

d

dent from a phine with no keynoard

-----Original Message-----
From: xxxxx@gmail.com
Sent: Monday, February 14, 2011 11:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Bugcheck when uninstalling

I get a bugcheck when uninstalling the driver. This is a statistical phenomenon that happens once in several hundreds un-installs.
I get the following dump:
STACK_TEXT:
8a01f3e4 828e36d5 00000003 6083dcd2 00000065 nt!RtlpBreakWithStatusInstruction
8a01f434 828e41d1 00000003 83fdb020 855e8988 nt!KiBugCheckDebugBreak+0x1c
8a01f7f8 828e3574 00000093 000008ec 00000000 nt!KeBugCheck2+0x68b
8a01f81c 82a2ae50 00000093 000008ec 00000000 nt!KeBugCheckEx+0x1e
8a01f870 82a55dd9 88c01cb0 94de31d8 83f2f480 nt!ObpCloseHandleTableEntry+0x1b2
8a01f8a0 82a55f7f 83f2f480 00000000 8a01f944 nt!ObpCloseHandle+0x7f
8a01f8bc 8284779a 800008ec 8a01f950 828450f9 nt!NtClose+0x4e
8a01f8bc 828450f9 800008ec 8a01f950 828450f9 nt!KiFastCallEntry+0x12a
8a01f938 871e47fc 800008ec 85a28378 871e4906 nt!ZwClose+0x11
8a01f944 871e4906 85a28378 8a01f970 871a3f8e Wdf01000!FxRegKey::~FxRegKey+0x19
8a01f950 871a3f8e 00000001 871e281b 00000000 Wdf01000!FxRegKey::`scalar deleting destructor’+0xd
8a01f958 871e281b 00000000 00000000 00000000 Wdf01000!FxObject::SelfDestruct+0xb
8a01f970 871a3fd6 85a28378 85a2838c 8a01f99c Wdf01000!FxObject::ProcessDestroy+0xa6
8a01f980 871e2951 00000000 000004b1 871fb5a8 Wdf01000!FxObject::Release+0x42
8a01f99c 871e2aaa 85a28300 00000001 8416e950 Wdf01000!FxObject::DeletedAndDisposedWorkerLocked+0xb2
8a01f9bc 871e293a 8416e96c 8416e950 8a01f9e0 Wdf01000!FxObject::ParentDeleteEvent+0x83
8a01f9cc 871e3198 8416e900 00000000 8416e950 Wdf01000!FxObject::DeletedAndDisposedWorkerLocked+0x9b
8a01f9e0 871e331d 8416e900 00000001 8410fcc8 Wdf01000!FxObject::DeleteWorkerAndUnlock+0xb8
8a01fa00 871cb67f 8a01fb90 84104308 8a01fa1c Wdf01000!FxObject::DeleteObject+0x179
8a01fa10 92f78259 84104308 8a01fb74 82ac1e25 Wdf01000!FxDriver::Unload+0x62
8a01fa1c 82ac1e25 84104308 6083d392 96dd6bb8 vjoy!FxStubDriverUnload+0x1a [d:\vistartm\drivers\wdf\kmdf\src\dynamic\stub\stub.cpp @ 153]
8a01fb74 829cce30 00000001 84234b98 9223f1c8 nt!IopUnloadDriver+0x338
8a01fb98 828e0a27 94dacc18 84234b98 00000001 nt!PnpUnloadAttachedDriver+0x73
8a01fbbc 82ac4af7 00000015 94dacc18 00000000 nt!PnpRemoveLockedDeviceNode+0x1e1
8a01fbd0 82ac4dab 00000002 00000015 00000000 nt!PnpDeleteLockedDeviceNode+0x2d
8a01fc04 82ac8789 841e2b08 94dacc18 00000002 nt!PnpDeleteLockedDeviceNodes+0x4c
8a01fcc4 829c3bae 8a01fcf4 00000000 982104e8 nt!PnpProcessQueryRemoveAndEject+0x946
8a01fcdc 829bdfb7 00000000 85670d50 83fdb020 nt!PnpProcessTargetDeviceEvent+0x38
8a01fd00 8286d043 85670d50 00000000 83fdb020 nt!PnpDeviceEventWorker+0x216
8a01fd50 829f9d16 00000001 6083d576 00000000 nt!ExpWorkerThread+0x10d
8a01fd90 8289b159 8286cf36 00000001 00000000 nt!PspSystemThreadStartup+0x9e
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x19

You might guess that my driver is vjoy, but there is no such function as FxStubDriverUnload in my code. Is it a callback? How do I locate the error in my code?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thank you Tim & Doron.
It seems to me now that I made errors in deleting a control device but I’ll have to look into it. What I did was to put many calls to DbgPrint() and see what were the last ones when the machine crashes. The problem with this method as I used it is the the messages are displayed on traceview on the test machine. Not very wise of me. Is there a way to run testview on a remote machine? I could not find how.