The event object is invalid; KeWaitForSingleObject accesses the structure
while holding the dispatcher database lock (a spin lock) and is thus at
elevated IRQL. Or a parameter you are passing to KeWaitForSingleObject is
invalid (and pageable would equate to invalid).
Do you have a stack backtrace? My guess is that this bugcheck is being
called from KiTrap0E (page fault handler) because there is an invalid data
structure; you can walk back (from the point of the fault) to figure out
which data structure is being used at the time of the fault. I have no idea
how one would do that with Softice. With WinDBG it is straight-forward.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: Seshagiri Babu K V [mailto:xxxxx@sasken.com]
Sent: Wednesday, January 08, 2003 4:55 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Call to Wait on Mutex Obj crashing
Hi Mark,
The bugcheck code is IRQL_NOT_LESS_OR_EQUAL. And in the parameters, the
Irql is 2. I have verified the Irql before the call to
KeWaitForSingleObject. Its at PASSIVE_LEVEL, the same thread in which the
start device handler runs.
The code is very scattered and will be very bulk on the list messages.
Briefly, the declaration of mutex has been done as
struct DEVICE_EXTENSION
{
::
::
KMUTEX ExecMutex;
::
::
};
And in the StartDevice handler i declare a virable of LARGE_INTEGER for
timeout and make the KeWaitForSingleObject call. At this instance the Mutex
is already signalled in the sense that this is the first try for acquiring
the mutex after it has been initialized for level 1.
As you told, alertable need not be TRUE. I have changed this and still the
code is crashing. This is the case even after i remove the timer.
And finally…when i debugged into the Assembly code using SOFTICE, the call
actually is KeWaitForMutexObject and then KeRaiseIrqlToDpcLevel and then
this crash. I don’t quite understand why this KeRaiseIrqlToDpcLevel call
came here.
Pls suggest some way out…
Thanks,
Giri.
----- Original Message -----
From: “Mark Roddy”
To: “NT Developers Interest List”
Sent: Tuesday, January 07, 2003 7:46 PM
Subject: [ntdev] Re: Call to Wait on Mutex Obj crashing
> You haven’t provided enough information. You’ve provided a code sample
that is obviously not
> the code you actually are trying to debug. Perhaps the error is in the
actual code? What
> exactly is the bugcheck? How have you declared the ExecMutex object and
the time value?
> Actually why are you using a timer value at all here? Finally, why are you
waiting alertable?
>
> At a minimum I think your call to KeWaitForSingleObject ought to be:
>
> KeWaitForSingleObject((&ExecMutex, Executive, KernelMode, FALSE, NULL);
>
> You do not care about being alerted and there is no point in timing out.
But that is most
> likely not your bug, which is instead likely to be an incorrect timer
storage declaration or
> an incorrect storage specification for the execmutex, or for some reason
you are at
> DISPATCH_LEVEL when you called KeWaitForSingleObject.
>
> ===========================
> Mark Roddy
> Consultant, Microsoft DDK MVP
> Hollis Technology Solutions
> xxxxx@hollistech.com
> www.hollistech.com
> 603-321-1032
>
>
> -----Original Message-----
> From: “Seshagiri Babu K V”
> To: “NT Developers Interest List”
> Date: Tue, 7 Jan 2003 15:08:57 +0530
> Subject: [ntdev] Call to Wait on Mutex Obj crashing
>
> > Hi,
> > Iam writing a pnp driver and am using a Mutext Object for
> > synchronization. This mutex object is a part of device extension.
> >
> > Iam doing the following:
> >
> > AddDevice: KeInitilaizeMutex Level(&ExecMutex,1);
> >
> > StartDevice : KeWaitForSingleObject (&ExecMutex,
> >
> > Executive,
> >
> > KernelMode,
> >
> > TRUE,
> >
> > &Time); /* Time = 10ms */
> >
> > This is the first time, i try to acquire the Mutex after initializing
> > it and the call KeWaitForSingleObject is crashing.
> >
> > Can someone tell me what the reason might be?
> >
> > Thanks,
> > Giri.
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@hollistech.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@sasken.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com