You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vardumpFiles=_processDumpUtility.GetDumpFiles(true,/* if we killed it by hang dumper, we already have our dump, otherwise it might have crashed, and we want all dumps */!hangDumpSuccess);
// [16:07:09] Dump 1 complete: 11034 MB written in 10.1 seconds
79
+
// We also want to know when we completed writing a dump (and not just set _isCrashDumpInProgress once), because dumpcount larger than 1
80
+
// can be provided externally and then the first dump would prevent hangdump forever from stopping the process, but the not every dump is crashing the process
81
+
// so we would run forever.
82
+
//
83
+
// Yes the two ifs below depend on the content being in english, and containg those words (which is the case for procdump from 2017 till 2023 at least),
84
+
// if we get different language it should not break us, we will just cancel more aggressively (unfortunately).
85
+
if(data!=null&&data.Contains("initiated"))
86
+
{
87
+
EqtTrace.Info($"ProcDumpDumper.OutputReceivedCallback: Output received from procdump process contains 'initiated', crashdump is being written. Don't cancel procdump right now.");
88
+
_isCrashDumpInProgress=true;
89
+
}
90
+
91
+
if(data!=null&&data.Contains("complete"))
92
+
{
93
+
EqtTrace.Info($"ProcDumpDumper.OutputReceivedCallback: Output received from procdump process contains 'complete' dump is finished, you can cancel procdump if you need.");
EqtTrace.Error($"ProcDumpDumper.ErrorReceivedCallback: Error received from procdump process: {data??"<null>"}");
100
+
76
101
/// <inheritdoc/>
77
102
publicvoidWaitForDumpToFinish()
78
103
{
79
-
if(_processHelper==null)
104
+
if(_procDumpProcess==null)
80
105
{
81
106
EqtTrace.Info($"ProcDumpDumper.WaitForDumpToFinish: ProcDump was not previously attached, this might indicate error during setup, look for ProcDumpDumper.AttachToTargetProcess.");
EqtTrace.Info($"ProcDumpDumper.DetachFromTargetProcess: ProcDump was not previously attached, this might indicate error during setup, look for ProcDumpDumper.AttachToTargetProcess.");
EqtTrace.Info($"ProcDumpDumper.DetachFromTargetProcess: ProcDump is currently dumping process '{targetProcessId}', wait at most {_timeout} ms for it to finish so we get the crashdump.");
EqtTrace.Info($"ProcDumpDumper.DetachFromTargetProcess: ProcDump detaching from target process '{targetProcessId}'.");
204
+
// Alternative to sending this event is calling Procdump -cancel <targetProcessId> (the dumped process id, not the existing Procdump.exe process id).
205
+
// But not all versions of procdump have that parameter (definitely not the one we are getting from the Procdump 0.0.1 nuget package), and it works reliably.
206
+
// What was not reliable before was that we sent the message and immediately killed procdump, that caused testhost to crash occasionally, because procdump was not detached,
207
+
// and killing the process when it is not detached takes the observed process with it.
EqtTrace.Info("ProcDumpDumper.DetachFromTargetProcess: Procdump process is still running after cancellation, force killing it. This will probably take down the process it is attached to as well.");
_mockDataCollectionSink.Setup(x =>x.SendFileAsync(It.IsAny<FileTransferInformation>())).Callback(()=>hangBasedDumpcollected.Set()).Throws(newException("Some other exception"));
249
249
250
250
_blameDataCollector.Initialize(
@@ -256,7 +256,7 @@ public void InitializeWithDumpForHangShouldCaptureKillTestHostOnTimeoutEvenIfAtt
0 commit comments