diff --git a/trunk/CHANGELOG.txt b/trunk/CHANGELOG.txt index b2a013a0b..f9120a86a 100644 --- a/trunk/CHANGELOG.txt +++ b/trunk/CHANGELOG.txt @@ -23,6 +23,7 @@ Process Hacker * #2845427 - "Indicator integer overflow" * #2847691 - "Apply button bug" * #2849052 - "not defined by current visual style" + * #2863305 - "Unhandled exception in comparer" * Critical KProcessHacker denial-of-service security issues * Incorrect menu items for System threads * Crash when viewing error details in the event diff --git a/trunk/ProcessHacker/Components/ProcessTree/ProcessTreeModel.cs b/trunk/ProcessHacker/Components/ProcessTree/ProcessTreeModel.cs index 4264d4782..745c4d3b8 100644 --- a/trunk/ProcessHacker/Components/ProcessTree/ProcessTreeModel.cs +++ b/trunk/ProcessHacker/Components/ProcessTree/ProcessTreeModel.cs @@ -237,6 +237,15 @@ namespace ProcessHacker nodes.Sort(new Comparison(delegate(ProcessNode n1, ProcessNode n2) { + // We have a problem here - the GdiHandlesNumber and UserHandlesNumber + // properties are dynamically retrieved, so if n1 == n2 we may end up + // getting different values for the same process due to the timing. + // If we do, then Array.Sort will throw an exception. + // + // The temporary HACK used here is to return 0 whenever n1 == n2. + if (n1 == n2) + return 0; + switch (sortC) { case "name":