Skip to content

Commit b152595

Browse files
authored
Add test for malformed GUID in XML call stack cases (#109)
1 parent 423c626 commit b152595

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Engine/ModuleInfoHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ await Task.Run(() => Parallel.ForEach(listOfCallStacks, currItem => {
125125
continue;
126126
}
127127
} catch (Exception ex) {
128-
if (!(ex is ArgumentNullException || ex is NullReferenceException || ex is XmlException)) { throw; }
128+
if (!(ex is ArgumentNullException || ex is NullReferenceException || ex is XmlException || ex is FormatException)) { throw; }
129129
}
130130
}
131131

Tests/Tests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ private string PrepareLargeXEventInput() {
505505
var ret = await csr.ResolveCallstacksAsync(await csr.GetListofCallStacksAsync(input, false, cts), pdbPath, false, null, false, true, false, true, false, false, null, cts);
506506
var expected = @"00 ntdll!NtWaitForSingleObject+20";
507507
Assert.AreEqual(expected.Trim(), ret.Trim());
508+
input = "<frame id=\"00\" pdb=\"ntdll.pdb\" age=\"1\" guid=\"C374E059-5793-9B92-A6525-386A66A2D3F5\" module=\"ntdll.dll\" rva=\"0x9F7E4\" />";
509+
ret = await csr.ResolveCallstacksAsync(await csr.GetListofCallStacksAsync(input, false, cts), pdbPath, false, null, false, true, false, true, false, false, null, cts);
510+
Assert.AreEqual(input.Trim(), ret.Trim());
508511
}
509512

510513
/// End-to-end test with stacks being resolved based on symbols from symsrv.

0 commit comments

Comments
 (0)