Fix crashes when tracing enabled and Socket disposed during connect (#35964)
authorStephen Toub <stoub@microsoft.com>
Thu, 7 May 2020 16:38:33 +0000 (12:38 -0400)
committerGitHub <noreply@github.com>
Thu, 7 May 2020 16:38:33 +0000 (12:38 -0400)
commit6478a0d4b74e2e44238a436be7a94c377389de4a
tree7c17b958b2563417d8decbff72a57a47b30bb7eb
parent24c599aecbe34c3a0e77fe3a95849f94912acd80
Fix crashes when tracing enabled and Socket disposed during connect (#35964)

Given the right (wrong) sequence of events, if tracing is enabled and a Socket is disposed of during a connect operation, the tracing code might try to access properties on the Socket that throw ObjectDisposedException, and these exceptions may propagate and crash the process.
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs