3

概括:

  • 为了发现 32 位进程中的内存泄漏源,收集了一系列内存转储。
  • 尝试使用调试诊断分析转储在两小时后失败,报告超时异常。
  • 在 DebugDiag.Analysis.exe.config 中提供“AnalysisCompletedTimeout”参数并指定 4 小时的超时确实可以成功阻止报告超时异常。相反,2 小时后,我看到生成了一个完全空的报告。

似乎我试图解决超时问题的尝试只是部分成功。我的问题是就如何使分析成功生成分析报告征求建议。

更多细节:

根据要求,客户向我们提供了一系列用于 32 位 COM+ 服务器应用程序的内存转储。这个想法是使用 LeakTrack dll 来帮助追踪在此过程中观察到的一些内存泄漏的来源。

启动调试诊断分析工具,并添加转储文件。选中“MemoryAnalysis”复选框后,开始分析。两小时后,分析工具会显示一个报告问题的消息框:

No report file was generated
---------------------------
An error occurred while generating the analysis report

Exception:
    Type:   TimeoutException

    Message:    This request operation sent to net.pipe://localhost/15466de6-db7d-477f-aac4-42980eb2f27f did not receive a reply within the configured timeout (02:00:00).  The time allotted to this operation may have been a portion of a longer timeout.  This may be because the service is still processing the operation or because the service was unable to send a reply message.  Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.

    StackTrace: 

Server stack trace: 
   at System.ServiceModel.Dispatcher.DuplexChannelBinder.SyncDuplexRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)


Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at DebugDiag.DotNet.x86Analysis.IAnalysisService.RunAnalysisRules(List`1 analysisRuleInfos, List`1 dumpFiles, String symbolPath, String imagePath, String reportFileFullPath, TimeSpan timeout, Boolean twoTabs, Boolean includeSourceAndLineInformationInAnalysisReports, Boolean setContextOnCrashDumps, Boolean doHangAnalysisOnCrashDumps, Boolean includeHttpHeadersInClientConns, Boolean groupIdenticalStacks, Boolean includeInstructionPointerInAnalysisReports, List`1& facts)
   at DebugDiag.DotNet.NetAnalyzer.RunX86Analysis(NetProgress progress, List`1 dumpFiles, List`1 analysisRuleInfos, String symbolPath, String imagePath, String reportFileFullPath, Boolean twoTabs, NetResults& results, List`1& facts)
   at DebugDiag.DotNet.NetAnalyzer.RunAnalysisRulesInternal(DumpFileType bitness, NetProgress progress, String symbolPath, String imagePath, String reportFileFullPath, Boolean twoTabs, AnalysisModes analysisMode)
   at DebugDiag.DotNet.NetAnalyzer.RunAnalysisRules(NetProgress progress, String symbolPath, String imagePath, String reportFileDirectoryOrFullPath, Boolean twoTabs, AnalysisModes analysisMode)
   at DebugDiag.Analysis.AnalyzerClient.RunAnalysisAsyncInternal(NetProgress progress, String symbolPath, String imagePath, List`1 dumpFiles, List`1 analysisRules, String reportFileDirectoryOrFullPath, Boolean IncludeSourceAndLineInformationInAnalysisReports, Boolean SetContextOnCrashDumps, Boolean DoHangAnalysisOnCrashDumps, Boolean IncludeHttpHeadersInClientConns, SynchronizationContext synchContext, Boolean ExcludeIdenticalStacks, Boolean IncludeInstructionPointerInAnalysisReports)

在使用 JetBrains dotPeek 浏览了 DebugDiag 分析工具程序集后,我对 DebugDiag.Analysis.exe.config 进行了更改,以尝试将超时设置更改为 4 小时:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="DebugDiag.DotNet.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <applicationSettings>
    <DebugDiag.DotNet.Properties.Settings>
      <setting name="AnalysisCompletedTimeout" serializeAs="String">
        <value>04:00:00</value>
      </setting>
    </DebugDiag.DotNet.Properties.Settings>
  </applicationSettings>
  <startup> 
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
  <system.net>
    <defaultProxy useDefaultCredentials="true">
    </defaultProxy>
  </system.net>
</configuration>

重试分析后,该工具再次工作约 2 小时。完成后,Internet Explorer 会启动它的报告,结果证明是完全空白的。检查 DebugDiag 报告文件夹会发现 .mht 报告文件的大小为 0 字节。但是,这次没有显示“超时异常”消息框。

所以我的问题是:为什么没有生成报告?是否需要添加/修改其他配置设置以允许报告完成,无论是在调试诊断分析主机进程中还是在调用 (UI) 进程中?

为了尝试查看可能出现的其他问题,我确实在分​​析进行后将 windbg 附加到进程 DebugDiag.x86AnalysisHost.exe。我希望我能够看到其他异常情况的证据,这些情况可以为正在发生的事情提供线索。然而,该过程似乎以受控方式退出,没有表现出异常情况。

欢迎提出下一步去哪里的建议。

4

1 回答 1

1

我还要补充一点,我收到这个超时问题。

遗憾的是,试图找到有关如何配置 .config 的任何信息有点问题,因为它似乎不存在。

DebugDiag 报告的消息 如果我解决了,我会更新这篇文章,但我希望包含错误消息会有所帮助。

于 2019-08-08T08:15:51.897 回答