应用程序验证程序自动进程转储文件创建

Nic*_*nks 5 windows windows-services windbg application-verifier

我知道如何手动使用 AppVerif 和 windbg 来调试进程问题,但我正在组装一个自动化系统来运行一系列压力测试,而无需用户在场。

我需要一种方法来在 AppVerif 发现问题时生成进程转储,然后继续(假设这是一个非致命错误)。

有没有一种方法可以将 AppVerif 配置为正确地生成进程的转储而不是闯入,或者我是否必须附加 windbg 并以某种方式使其自动化以在中断时创建转储,然后继续。

Han*_*ant 2

不,这不是 appverif.exe 的内置功能。不是真正的问题,您可以使用另一个程序来生成小型转储。就像SysInternals 的 ProcDump 实用程序一样。

运行 appverif.exe 以配置您的测试应用程序。您想要更改 ExceptionOnStop 属性(底部窗口)。将其设置为 TRUE,以便在测试失败时引发异常。

然后使用 procdump 运行测试,告诉它使用参数生成未处理异常的转储-e。例如:

  c:\bin\procdump -e -x . broken.exe
Run Code Online (Sandbox Code Playgroud)

当我在broken.exe上尝试时,它是故意损坏句柄的:

ProcDump v7.1 - Writes process dump files
Copyright (C) 2009-2014 Mark Russinovich
Sysinternals - www.sysinternals.com
With contributions from Andrew Richards

Process:               broken.exe (5892)
CPU threshold:         n/a
Performance counter:   n/a
Commit threshold:      n/a
Threshold seconds:     10
Hung window check:     Disabled
Log debug strings:     Disabled
Exception monitor:     Unhandled
Exception filter:      *
Terminate monitor:     Disabled
Cloning type:          Disabled
Concurrent limit:      n/a
Avoid outage:          n/a
Number of dumps:       1
Dump folder:           .\
Dump filename/mask:    PROCESSNAME_YYMMDD_HHMMSS


Press Ctrl-C to end monitoring without terminating the process.

[11:23:30] Exception: C0000008.INVALID_HANDLE
[11:23:30] Exception: C0000421
[11:23:30] Unhandled: C0000421
[11:23:30] Dump 1 initiated: .\broken.exe_150713_112330.dmp
[11:23:30] Dump 1 complete: 1 MB written in 0.0 seconds
[11:23:31] Dump count reached.
Run Code Online (Sandbox Code Playgroud)

您可能需要更改写入转储文件的位置并添加一些自动化功能,以便在生成转储时收到通知。