简体   繁体   English

如何使用procdump -t - 转储进程终止 - 使用?

[英]How is procdump -t — dump on process termination — used?

The question may be a bit awkward, but here's my detailed problem: 这个问题可能有点尴尬,但这是我的详细问题:

Currently I'm looking into setting up SysInternals' procdump.exe to monitor an application of ours that exhibits spurious disappearances -- that is, the user reports that the application is simply "gone" without any trace after a short visible hang of the application's window. 目前我正在考虑设置SysInternals的procdump.exe以监控我们的应用程序,它显示虚假消失 - 也就是说,用户报告应用程序在应用程序的短暂可见挂起之后简单地“消失”而没有任何痕迹窗口。

My first idea was to run procdump -e -x . MyApp.exe 我的第一个想法是运行procdump -e -x . MyApp.exe procdump -e -x . MyApp.exe which would record a crash dump when the application encounters an unhandled exception, but then I saw that there is also a -t switch, that -- 当应用程序遇到未处理的异常时会记录崩溃转储的procdump -e -x . MyApp.exe ,但后来我发现还有一个-t开关, -

-t - Write a dump when the process terminates. -t - 进程终止时写入转储。

automatically generates a dump when the process terminates. 进程终止时自动生成转储。

Now the problem 现在问题

I have tested the -t switch with our app by inserting a ExitProcess or TerminateProcess call at a defined location where I can trigger it. 我已经使用我们的应用程序测试了-t开关,方法是在我可以触发它的已定义位置插入一个ExitProcessTerminateProcess调用。

While the app behaves as expected, ie TerminateProcess immediately "kills" the running app and ExitProcess takes a while because global cleanup is run, the dump generated this way is useless in both cases. 虽然应用程序的行为符合预期,即TerminateProcess立即“杀死”正在运行的应用程序并且ExitProcess需要一段时间,因为运行全局清理,这种方式生成的转储在这两种情况下都是无用的。

The dumps I get for -t always contain only a sinlge thread (where the app was running over 20 thread at termination time) and the callstack isn't even at a useful location. 我得到的转储-t总是只包含一个sinlge线程(应用程序在终止时运行超过20个线程),并且callstack甚至不在一个有用的位置。 (It just seems to be one random thread from the terminated app.) (它似乎是终止应用程序中的一个随机线程。)

Am I doing something wrong? 难道我做错了什么? Can I usefully use procdump -t to track down unexpected calls of process exit functions at all? 我可以使用procdump -t来跟踪进程退出函数的意外调用吗?

Can I usefully use procdump -t to track down unexpected calls of process exit functions at all? 我可以使用procdump -t来跟踪进程退出函数的意外调用吗?

I think not and here's why: test process calc.exe 我想不是,这就是原因:测试过程calc.exe

CommandLine: "C:\Program Files\Sysinternals\procdump.exe" -t calc.exe

I try to carefully suggest that procdump is waiting on calc.exe process handle. 我尝试小心地建议procdump正在等待calc.exe进程句柄。

0:000> kb
ChildEBP RetAddr  Args to Child              
0017f2e0 77135e6c 75336872 00000002 0017f334 ntdll!KiFastSystemCallRet
0017f2e4 75336872 00000002 0017f334 00000001 ntdll!NtWaitForMultipleObjects+0xc
0017f380 76cbf14a 0017f334 0017f3a8 00000000 KERNELBASE!WaitForMultipleObjectsEx+0x100
0017f3c8 76cbf2c2 00000002 7ffdb000 00000000 kernel32!WaitForMultipleObjectsExImplementation+0xe0
0017f3e4 011c6135 00000002 0017f46c 00000000 kernel32!WaitForMultipleObjects+0x18
WARNING: Stack unwind information not available. Following frames may be wrong.
0017fc30 011c999e 00000003 013d1de0 013d1e78 procdump+0x6135
0017fc78 76cc1194 7ffdb000 0017fcc4 7714b495 procdump+0x999e
0017fc84 7714b495 7ffdb000 77ad79b5 00000000 kernel32!BaseThreadInitThunk+0xe
0017fcc4 7714b468 011c99f5 7ffdb000 00000000 ntdll!__RtlUserThreadStart+0x70
0017fcdc 00000000 011c99f5 7ffdb000 00000000 ntdll!_RtlUserThreadStart+0x1b
0:000> dd 17f46c
0017f46c  00000238 00000268
0:000> !handle 238 f
Handle 238
  Type          Process
  Attributes    0
  GrantedAccess 0x1fffff:
         Delete,ReadControl,WriteDac,WriteOwner,Synch
         Terminate,CreateThread,,VMOp,VMRead,VMWrite,DupHandle,CreateProcess,SetQuota,SetInfo,QueryInfo,SetPort
  HandleCount   5
  PointerCount  52
  Name          <none>
  Object Specific Information
    Process Id  1580
    Parent Process  2476
    Base Priority 8

在此输入图像描述

In the crash dump file gets stack last complete process thread (TID 3136) just before the end of the process. 在崩溃转储文件中,在进程结束之前获取堆栈最后一个完整的进程线程(TID 3136)。

0:000> ~
.  0  Id: dc8.c40 Suspend: -1 Teb: 7ffdd000 Unfrozen
0:000> .formats c40
Evaluate expression:
  Hex:     00000c40
  Decimal: 3136

在此输入图像描述

Crash dump file is created after the completion of the last thread, and before the end of the process. 崩溃转储文件是在最后一个线程完成之后和进程结束之前创建的。

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM