mhutch / MonoDevelop.MSBuildEditor

Improved MSBuild editing support
Other
228 stars 26 forks source link

Infinite CPU due to unprotected write to a HashSet<T> #248

Closed davkean closed 2 months ago

davkean commented 2 months ago

Visual Studio CPU telemetry has caught an issue where this extension is writing to a HashSet\<T> from multiple threads at the same time, which is currupting in a way that causes usages to turn into an infinite loop.

Please protect this HashSet<T> with a lock, or replace with it a ConcurrentDictionary<TKey, TValue>.

Here's an example where we captured a trace where the following paths were burning just over 4 cores over the space of 80 seconds:

image