关于中断&dpc定时器

Windows内核调试

关于中断&dpc定时器


特来劲同学 2010-12-18, 11:20 上午

我在调试的过程中,发现某一个定时器dpc被频繁的调用,如下
f7a18e64 ee18635e 804f4758 861ec4f0 00000000 xxxxx+0x268a
f7a18e88 80500d88 80552840 00000000 f429d6f8 xxxxx+0x635e
f7a18fa4 80500e9f 3e42cc71 0000001e ffdff000 nt!KiTimerListExpire+0x122 (FPO: [0,62,0])
f7a18fd0 80542b8d 80553da0 00000000 000caf56 nt!KiTimerExpiration+0xaf (FPO: [4,6,0])
f7a18ff4 8054285a eebedb44 00000000 00000000 nt!KiRetireDpcList+0x46 (FPO: [0,0,0])
f7a18ff8 eebedb44 00000000 00000000 00000000 nt!KiDispatchInterrupt+0x2a (FPO: [Uses EBP] [0,0,1])
8054285a 00000000 00000009 bb835675 00000128 0xeebedb44
请问下各位前辈和老师,如何找到相应的定时器对象?如何查找到当前指令时在哪个中断处理中?(也有可能是系统时钟中断,但怎么能看到?)

Re: 关于中断&dpc定时器


特来劲同学 2010-12-18, 11:57 上午

刚才又调试了下,又发现一个疑问

kd> k
ChildEBP RetAddr 
WARNING: Stack unwind information not available. Following frames may be wrong.
f7a18e64 ee18635e xxxxx+0x268a
f7a18e88 80500d88 xxxxx+0x635e
f7a18fa4 80500e9f nt!KiTimerListExpire+0x122
f7a18fd0 80542b8d nt!KiTimerExpiration+0xaf
f7a18ff4 8054285a nt!KiRetireDpcList+0x46
f7a18ff8 ee2a2c04 nt!KiDispatchInterrupt+0x2a
8054285a 00000000 0xee2a2c04
kd> !thread
THREAD 86340a38  Cid 05ac.04e4  Teb: 7ffdd000 Win32Thread: e11a6348 RUNNING on processor 0
IRP List:
    8618fae0: (0006,0190) Flags: 00000030  Mdl: 861627a8
    86335bd8: (0006,0190) Flags: 00000030  Mdl: 866b78b0
    86720630: (0006,0190) Flags: 00000000  Mdl: 00000000
Not impersonating
DeviceMap                 e1b08420
Owning Process            0       Image:         <Unknown>
Attached Process          861d8540       Image:         XXXX.exe
Wait Start TickCount      110483         Ticks: 1 (0:00:00:00.015)
Context Switch Count      462724                 LargeStack
UserTime                  00:00:53.437
KernelTime                00:14:32.328
Win32 Start Address XXXX (0x0225817b)
Start Address kernel32!BaseProcessStartThunk (0x7c8106f5)
Stack Init ee2a3000 Current ee2a2b94 Base ee2a3000 Limit ee29e000 Call 0
Priority 8 BasePriority 8 PriorityDecrement 0 DecrementCount 16
ChildEBP RetAddr  Args to Child             
WARNING: Stack unwind information not available. Following frames may be wrong.
f7a18e64 ee18635e 804f4758 8634a030 00000000 xxxxx+0x268a
f7a18e88 80500d88 80552840 00000000 7f440a14 xxxxx+0x635e
f7a18fa4 80500e9f 04f66208 00000004 ffdff000 nt!KiTimerListExpire+0x122 (FPO: [0,62,0])
f7a18fd0 80542b8d 80553da0 00000000 0001af94 nt!KiTimerExpiration+0xaf (FPO: [4,6,0])
f7a18ff4 8054285a ee2a2c04 00000000 00000000 nt!KiRetireDpcList+0x46 (FPO: [0,0,0])
f7a18ff8 ee2a2c04 00000000 00000000 00000000 nt!KiDispatchInterrupt+0x2a (FPO: [Uses EBP] [0,0,1])
8054285a 00000000 00000009 bb835675 00000128 0xee2a2c04

dpc不是在一个特定的内核栈中执行的么?怎么2个k命令显示的结果是一样?  求老师和各位前辈教育

Re: 关于中断&dpc定时器


特来劲同学 2010-12-18, 12:09 下午
我个人理解,dpc的执行是在一个中断处理的后半部提交的(无论是时钟中断还是硬件中断,还有一种不是次中情况那就是idl线程),那么在当前线程中应该有相应的栈记录,可是为什么没有显示呢?我用dds貌似也没找到相关信息....

Re: 关于中断&dpc定时器


特来劲同学 2010-12-18, 15:11 下午

调了搞了半天,疑问越来越多,现在的几个问题都没有解决。。郁闷

1.此dpc定时器是在哪个中断(也可能是idl或时钟,idl可以明显显示出来看)后触发的?不过好像这个问题没什么多大意义,主要就是想找到这个中断

2.定位定时器对象

3.dpc例程的地址(解决2的话这个就顺带解决了,现在假如2没解决的情况下如何找)

4.如何找到dpc定时器的设置者?kisettimerex在哪个模块里调用的。

求老师前辈们慷慨教育,晚辈不胜感激.

Re: 关于中断&dpc定时器


格蠹老雷 2010-12-18, 23:22 下午
栈回溯中的xxxxx是你自己的模块么?
如果需要帮忙, 产生一个dump文件, 压缩后发到我的信箱中

Re: 关于中断&dpc定时器


特来劲同学 2010-12-20, 14:04 下午

张老师的邮箱是多少啊?

Powered by Community Server Powered by CnForums.Net