System Hung/Frozen: Need help

Hello,

I’m testing my Win2K Bus Driver and the system hangs when I do a SHUTDOWN.
My driver has a thread running at LOW_REALTIME_PRIORITY, with CPU affinity
set to CPU 3 (on a 4 CPU system). This is a compute-bound thread.

WinDbg shows:
-CPUs 1, 2 and 3 in IdleLoop and
-CPU 0 in KeUpdateSystemTime()

I’ve enclosed the stack trace from WinDbg. Could somebody tell me how to
proceed to figure out what the problem is ?

Thanks much,
Puja

== windbg output ==

~
* 0 1 Stopped 1 _KiTimerExpireDpc
1 2 Running 1 0xFFFFFFFF80AC3800
2 3 Running 1 0xFFFFFFFF80ABD800
3 4 Running 1 0xFFFFFFFF80AB7800

kvbns

FramePtr RetAddr Param1 Param2 Param3 Function

Name
00 ffffffff80470518 ffffffff80466346 0000000000000001 fffffffff2487c02
00000000000000d1 NT!RtlpBreakWithStatusInstruction (FPO: [1,0,0])
01 ffffffff80470518 ffffffff80069bd5 0000000000000001 fffffffff2487c02
00000000000000d1 NT!KeUpdateSystemTime+0x14e (FPO: [0,2] TrapFrame @
8047052c)
02 ffffffff804705a4 ffffffff80450969 ffffffff8046c380 ffffffff8046c610
ffffffffffdff000 HAL!@HalAcpiC1Idle@4+0x15 (FPO: [0,2,0])
03 ffffffff804705b4 ffffffff804617c8 000000000000000e 0000000000000000
0000000000000000 NT!@PopProcessorIdle@4+0x71 (FPO: [0,0,3])

1f3 ffffffff8047fb64 ffffffffffdff800 ffffffff80431708 0000000000000000
00000000000101ef NT!KiTimerExpireDpc+0x4 (No FPO)
>
> ~1
>
> kvbns
# FramePtr RetAddr Param1 Param2 Param3 Function
Name
00 fffffffff2423d44 ffffffff80450969 ffffffff8046c380 ffffffff80ac8128
ffffffff80ac3000 HAL!@HalAcpiC1Idle@4+0x15 (FPO: [0,2,0])
01 fffffffff2423d54 ffffffff804617c8 000000000000000e 000000006db6db6d
ffffffffdb6db6db NT!@PopProcessorIdle@4+0x71 (FPO: [0,0,3])
02 ffffffff80ac3800 ffffffff80ac3800 0000000000000000 0000000000000000
00000000000042c3 NT!KiIdleLoop+0x10 (No FPO)
03 ffffffff80ac3800 ffffffff80ac3800 0000000000000000 0000000000000000
00000000000042c3 0xFFFFFFFF80AC3800 (No FPO)
>
> ~2
> kvbns
# FramePtr RetAddr Param1 Param2 Param3 Function
Name
00 fffffffff242bd44 ffffffff80450969 ffffffff8046c380 ffffffff80ac7488
ffffffff80abd000 HAL!@HalAcpiC1Idle@4+0x15 (FPO: [0,2,0])
01 fffffffff242bd54 ffffffff804617c8 000000000000000e 000000006db6db6d
ffffffffdb6db6db NT!@PopProcessorIdle@4+0x71 (FPO: [0,0,3])
02 ffffffff80abd800 ffffffff80abd800 0000000000000000 0000000000000000
0000000000003e76 NT!KiIdleLoop+0x10 (No FPO)
03 ffffffff80abd800 ffffffff80abd800 0000000000000000 0000000000000000
0000000000003e76 0xFFFFFFFF80ABD800 (No FPO)
>
> ~3
> kvbns
# FramePtr RetAddr Param1 Param2 Param3 Function
Name
00 fffffffff2433d54 ffffffff8046182e 000000000000000e 000000006db6db6d
ffffffffdb6db6db HAL!@HalAcpiC1Idle@4+0x15 (FPO: [0,2,0])
01 ffffffff80ab7800 ffffffff80ab7800 0000000000000000 0000000000000000
00000000000054bd NT!KiIdleLoop+0x76 (No FPO)
02 ffffffff80ab7800 ffffffff80ab7800 0000000000000000 0000000000000000
00000000000054bd 0xFFFFFFFF80AB7800 (No FPO)
>
> ~0
> !trap 8047052c
Debugger extension library [E:\mssdk\Bin\W2KFre\kdextx86] loaded
E:\mssdk\Bin\W2KFre\kdextx86 uses the old 32 bit extension API and may not
be fully
compatible with current systems.
eax=2eb9ce4d ebx=80068f0e ecx=ffdff890 edx=0000006a esi=ffdff878
edi=80481580
eip=80069bd5 esp=804705a0 ebp=ffdff800 iopl=0 nv up ei pl nz na po
nc
vip=0 vif=0
cs=0008 ss=0010 ds=058c es=d6fe fs=f848 gs=b1d8
efl=00000206
ErrCode = 00000000
80069BD5 FFD3 call ebx

> dc 80069bd5
HAL!@HalAcpiC1Idle@4+0x15:
80069BD5 FFD3 call ebx
80069BD7 5B pop ebx
80069BD8 59 pop ecx
80069BD9 894108 mov dword ptr [ecx+8],eax
80069BDC 89510C mov dword ptr [ecx+0Ch],edx
80069BDF 33C0 xor eax,eax
80069BE1 C3 ret
80069BE2 8BFF mov edi,edi

You should send a signal to your thread to tell it to stop. THen, have your
shutdown code to wait on the thread object to finish shutting down.

Not sure this is the problem, I have never has a thread bound to a specific
CPU.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of xxxxx@usa.net
Sent: Thursday, June 15, 2000 4:20 PM
To: NT Developers Interest List
Subject: [ntdev] System Hung/Frozen: Need help

Hello,

I’m testing my Win2K Bus Driver and the system hangs when I do a
SHUTDOWN.
My driver has a thread running at LOW_REALTIME_PRIORITY, with CPU
affinity
set to CPU 3 (on a 4 CPU system). This is a compute-bound thread.

WinDbg shows:
-CPUs 1, 2 and 3 in IdleLoop and
-CPU 0 in KeUpdateSystemTime()

I’ve enclosed the stack trace from WinDbg. Could somebody tell me how to
proceed to figure out what the problem is ?

Thanks much,
Puja

== windbg output ==

> ~
* 0 1 Stopped 1 _KiTimerExpireDpc
1 2 Running 1 0xFFFFFFFF80AC3800
2 3 Running 1 0xFFFFFFFF80ABD800
3 4 Running 1 0xFFFFFFFF80AB7800
>
> kvbns

FramePtr RetAddr Param1 Param2 Param3

Function
Name
00 ffffffff80470518 ffffffff80466346 0000000000000001 fffffffff2487c02
00000000000000d1 NT!RtlpBreakWithStatusInstruction (FPO: [1,0,0])
01 ffffffff80470518 ffffffff80069bd5 0000000000000001 fffffffff2487c02
00000000000000d1 NT!KeUpdateSystemTime+0x14e (FPO: [0,2] TrapFrame @
8047052c)
02 ffffffff804705a4 ffffffff80450969 ffffffff8046c380 ffffffff8046c610
ffffffffffdff000 HAL!@HalAcpiC1Idle@4+0x15 (FPO: [0,2,0])
03 ffffffff804705b4 ffffffff804617c8 000000000000000e 0000000000000000
0000000000000000 NT!@PopProcessorIdle@4+0x71 (FPO: [0,0,3])

> 1f3 ffffffff8047fb64 ffffffffffdff800 ffffffff80431708
> 0000000000000000
> 00000000000101ef NT!KiTimerExpireDpc+0x4 (No FPO)
> >
> > ~1
> >
> > kvbns
> # FramePtr RetAddr Param1 Param2 Param3
> Function
> Name
> 00 fffffffff2423d44 ffffffff80450969 ffffffff8046c380 ffffffff80ac8128
> ffffffff80ac3000 HAL!@HalAcpiC1Idle@4+0x15 (FPO: [0,2,0])
> 01 fffffffff2423d54 ffffffff804617c8 000000000000000e 000000006db6db6d
> ffffffffdb6db6db NT!@PopProcessorIdle@4+0x71 (FPO: [0,0,3])
> 02 ffffffff80ac3800 ffffffff80ac3800 0000000000000000 0000000000000000
> 00000000000042c3 NT!KiIdleLoop+0x10 (No FPO)
> 03 ffffffff80ac3800 ffffffff80ac3800 0000000000000000 0000000000000000
> 00000000000042c3 0xFFFFFFFF80AC3800 (No FPO)
> >
> > ~2
> > kvbns
> # FramePtr RetAddr Param1 Param2 Param3
> Function
> Name
> 00 fffffffff242bd44 ffffffff80450969 ffffffff8046c380 ffffffff80ac7488
> ffffffff80abd000 HAL!@HalAcpiC1Idle@4+0x15 (FPO: [0,2,0])
> 01 fffffffff242bd54 ffffffff804617c8 000000000000000e 000000006db6db6d
> ffffffffdb6db6db NT!@PopProcessorIdle@4+0x71 (FPO: [0,0,3])
> 02 ffffffff80abd800 ffffffff80abd800 0000000000000000 0000000000000000
> 0000000000003e76 NT!KiIdleLoop+0x10 (No FPO)
> 03 ffffffff80abd800 ffffffff80abd800 0000000000000000 0000000000000000
> 0000000000003e76 0xFFFFFFFF80ABD800 (No FPO)
> >
> > ~3
> > kvbns
> # FramePtr RetAddr Param1 Param2 Param3
> Function
> Name
> 00 fffffffff2433d54 ffffffff8046182e 000000000000000e 000000006db6db6d
> ffffffffdb6db6db HAL!@HalAcpiC1Idle@4+0x15 (FPO: [0,2,0])
> 01 ffffffff80ab7800 ffffffff80ab7800 0000000000000000 0000000000000000
> 00000000000054bd NT!KiIdleLoop+0x76 (No FPO)
> 02 ffffffff80ab7800 ffffffff80ab7800 0000000000000000 0000000000000000
> 00000000000054bd 0xFFFFFFFF80AB7800 (No FPO)
> >
> > ~0
> > !trap 8047052c
> Debugger extension library [E:\mssdk\Bin\W2KFre\kdextx86] loaded
> E:\mssdk\Bin\W2KFre\kdextx86 uses the old 32 bit extension API
> and may not
> be fully
> compatible with current systems.
> eax=2eb9ce4d ebx=80068f0e ecx=ffdff890 edx=0000006a esi=ffdff878
> edi=80481580
> eip=80069bd5 esp=804705a0 ebp=ffdff800 iopl=0 nv up ei pl
> nz na po
> nc
> vip=0 vif=0
> cs=0008 ss=0010 ds=058c es=d6fe fs=f848 gs=b1d8
> efl=00000206
> ErrCode = 00000000
> 80069BD5 FFD3 call ebx
>
>
> > dc 80069bd5
> HAL!@HalAcpiC1Idle@4+0x15:
> 80069BD5 FFD3 call ebx
> 80069BD7 5B pop ebx
> 80069BD8 59 pop ecx
> 80069BD9 894108 mov dword ptr [ecx+8],eax
> 80069BDC 89510C mov dword ptr [ecx+0Ch],edx
> 80069BDF 33C0 xor eax,eax
> 80069BE1 C3 ret
> 80069BE2 8BFF mov edi,edi
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>

Hi Jamey,

Your response raises an interesting question. In my code, I have a boolean
variable ThreadShouldStop which is:

-initialized to FALSE before the thread is created.
-In my thread:
while (!ThreadShouldStop) {
do processing
}
-When I get IRP_MN_REMOVE_DEVICE for my Bus FDO,
I set ThreadShouldStop = TRUE and
Wait on the ThreadObject

The above works fine when I don’t assign LOW_REALTIME_PRIORITY to my thread
AND I don’t set thread affinity i.e. there is no problem when I do
SHUTDOWN.

Questions: Why does the above work when I don’t set thread
priority/affinity ?
[At SHUTDOWN, IRP_MN_REMOVE_DEVICE is NOT sent => ThreadShouldStop is NEVER
set to TRUE] So how is my thread killed ?

Thanks in advance,
Puja

On 06/15/00, ““Jamey Kirby” ” wrote:
> You should send a signal to your thread to tell it to stop. THen, have your
> shutdown code to wait on the thread object to finish shutting down.
>
> Not sure this is the problem, I have never has a thread bound to a specific
> CPU.
>
> Jamey