Open Tim-Pohlmann opened 4 months ago
Concurrent code can easily cause FPs in our symbolic execution engine. E.g.:
class ErrorLogger { public Queue<Exception> Queue { get; set; } public async Task Start() { Queue = new(); do { await Task.Delay(1000); if (Queue.Dequeue() is { } exception) // FP: S4158 Console.WriteLine(exception); } while (true); } }
We should investigate approaches to increase our precision for concurrent code.
Some ideas:
lock
async
Concurrent code can easily cause FPs in our symbolic execution engine. E.g.:
We should investigate approaches to increase our precision for concurrent code.
Some ideas:
lock
- we already do this for S2583/S2589async
- this is most likely too broadasync
methods and methods that includelock
statements. This would fix the example above.