-
Notifications
You must be signed in to change notification settings - Fork 646
AccessVialotionException #556
Description

Windows Event Log showed me an AccessVialotionError in TcpConnectionFactory.clearOutdatedConnections
Because i have no other way of getting the error from the computer I hat to take a photo, sorry for that.
I'm using Version 3.0.895
I think the error occurs in this line:
var emptyKeys = cache.Where(x => x.Value.Count == 0).Select(x => x.Key).ToList();
As this site states, the error is ignored by the try/catch:
https://stackoverflow.com/questions/3469368/how-to-handle-accessviolationexception
AccessViolationException and try/catch blocks
Starting with the .NET Framework 4, AccessViolationException exceptions thrown by the common language runtime are not handled by the catch statement in a structured exception handler if the exception occurs outside of the memory reserved by the common language runtime. To handle such an AccessViolationException exception, you should apply the HandleProcessCorruptedStateExceptionsAttribute attribute to the method in which the exception is thrown. This change does not affect AccessViolationException exceptions thrown by user code, which can continue to be caught by a catch statement. For code written for previous versions of the .NET Framework that you want to recompile and run without modification on the .NET Framework 4, you can add the element to your app's configuration file. Note that you can also receive notification of the exceptions if you have defined a handler for the AppDomain.FirstChanceException or AppDomain.UnhandledException event.
There is also Information on this at StackOverflow:
https://stackoverflow.com/questions/3469368/how-to-handle-accessviolationexception
Maybe the root cause is hardware-issues as stated here:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/222e9ca4-8b3d-4106-9a23-88d5f80fd6a8/concurrentdictionary-threw-accessviolationexception?forum=netfxbcl
Maybe this method should be decorated with HandleProcessCorruptedStateExceptions-Attribute?