We are debugging usb modem driver in vista32. We have a fatal error when run driver.Vista32 system is dead when we call KeAcquireSpinLock at current IRQL==2. But the function discription is said we can use KeAcquireSpinLock at IRQL <= DISPATCH_LEVEL.So there is something wrong when we call KeAcquireSpinLock.
Can somebody help us?
Thank you very much!
You can certainly call KeAcquireSpinLock at DISPATCH_LEVEL- it happens all the time.
If by “dead” you mean “unresponsive/hung”, then the spinlock is already held and you have found a deadlock, most likelyin your code.
If you mean a bugcheck, then the spinlock address is most likely invalid or paged out- or the code that calls it may be pagable and was paged out while the spinlock was acquired.
There may be some other causes [can’t think of any off-hand, but that doesn’t mean there aren’t], but those would be the most common by far, and they’re all design issues / bugs in some driver somewhere, generally the one you find them in.
It usually doesn’t take very long to decipher these with a debugger- for instance, if it’s already held, the code that acquired it is often further up your call stack- fastest self-inflicted deadlock in creation.
>>
There may be some other causes [can’t think of any off-hand, but that doesn’t
mean there aren’t]
<<
Like say having an invalid or paged out location for the previous IRQL parameter? Never accuse *me* of being thorough :).
If you are seeing a bluescreen, please send the output of !analyze -v
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Tuesday, November 20, 2007 11:46 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Why can’t use KeAcquireSpinLock in Vista32 when IRQL==2?
We are debugging usb modem driver in vista32. We have a fatal error when run driver.Vista32 system is dead when we call KeAcquireSpinLock at current IRQL==2. But the function discription is said we can use KeAcquireSpinLock at IRQL <= DISPATCH_LEVEL.So there is something wrong when we call KeAcquireSpinLock.
Can somebody help us?
Thank you very much!
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
hi Bob,
Thank you for your answer.We have found the error. when deal IRP_MJ_DEVICE_CONTROL,the first IRP is not compelet, then the second is come.In the two case we use same spin lock,so the system is dead lock.The same code can work well in XP,but dead lock in Vistar.May be two system are something different.
We plan to add a queue to deal with the IRP for IRP_MJ_DEVICE_CONTROL.
Thank you!
qhwang
Hi Doron,
Thank you for your answer.We had used !analyze -v in windbg.
Thanks!
qhwang
xxxxx@hotmail.com wrote:
We plan to add a queue to deal with the IRP for IRP_MJ_DEVICE_CONTROL.
Normal practice is to use some sort of a queue for all irps …
MH.
Is the XP machine a uniprocessor (UP) one?
SMP and UP kernels have different implementations for the spinlock (on a UP
machine, it just raises the IRQL to dispatch level).
And if I remember well, Vista uses the SMP kernel even on UP machines.
Hope it helps
GV
–
Gianluca Varenni, Windows DDK MVP
CACE Technologies
http://www.cacetech.com
----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Thursday, November 22, 2007 1:04 AM
Subject: RE:[ntdev] Why can’t use KeAcquireSpinLock in Vista32 when IRQL==2?
> hi Bob,
> Thank you for your answer.We have found the error. when deal
> IRP_MJ_DEVICE_CONTROL,the first IRP is not compelet, then the second is
> come.In the two case we use same spin lock,so the system is dead lock.The
> same code can work well in XP,but dead lock in Vistar.May be two system
> are something different.
> We plan to add a queue to deal with the IRP for IRP_MJ_DEVICE_CONTROL.
>
> Thank you!
> qhwang
>
> —
> 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