Skip to content

Commit e77e836

Browse files
Handle truncated XML frame info gracefully
When the XML frame has insufficient information, gracefully handle the case by returning the input as-is, instead of the earlier behavior of throwing an internal exception and failing.
1 parent eccf17a commit e77e836

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Engine/ModuleInfoHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ await Task.Run(() => Parallel.ForEach(listOfCallStacks, currItem => {
9696
var pdbGuid = reader.GetAttribute("guid");
9797
var pdbAge = reader.GetAttribute("age");
9898
string uniqueModuleName;
99-
// createe a map of the last mapped module names to handle cases when the frame is "truncated" and the above PDB details are not available
99+
// Create a map of the last mapped module names to handle cases when the frame is "truncated" and the above PDB details are not available
100100
if (pdbGuid != null && pdbAge != null) {
101101
uniqueModuleName = $"{pdbGuid.Replace("-", string.Empty).ToUpper()}{pdbAge}";
102102
if (latestMappedModuleNames.ContainsKey(moduleName)) latestMappedModuleNames[moduleName] = uniqueModuleName;
103103
else latestMappedModuleNames.Add(moduleName, uniqueModuleName);
104104
} else {
105105
if (!latestMappedModuleNames.TryGetValue(moduleName, out uniqueModuleName)) {
106-
anyTaskFailed = true;
107-
return;
106+
outCallstack.AppendLine(line);
107+
continue;
108108
}
109109
}
110110
lock (syms) {

Tests/Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ private string PrepareLargeXEventInput() {
616616
// modify the input to not have any prior PDB info - this will be an "error" case
617617
input = "Frame = <frame id=\"02\" name=\"sqldk.dll\" address = \"0x100440609\"/>\r\n<frame id=\"03\" name=\"sqldk.dll\" address=\"0x10042249f\" />\n";
618618
ret = await csr.ResolveCallstacksAsync(await csr.GetListofCallStacksAsync(input, false, cts), pdbPath, false, null, false, true, false, true, false, false, null, cts);
619-
Assert.IsTrue(ret.StartsWith("Unable to determine symbol information from XML frames"));
619+
Assert.AreEqual("<frame id=\"02\" name=\"sqldk.dll\" address = \"0x100440609\"/>\r\n<frame id=\"03\" name=\"sqldk.dll\" address=\"0x10042249f\" />", ret.Trim());
620620
}
621621

622622
/// End-to-end test with XE histogram target and XML frames.

0 commit comments

Comments
 (0)