Deadlock in .NET client websocket stop logic #1120

Closed
davidfowl opened this Issue Dec 11, 2012 · 1 comment

Projects

None yet

2 participants

@davidfowl
SignalR member

Cancellation tokens strike again!

mscorlib_ni!System.Threading.SpinWait.SpinOnce()
mscorlib_ni!System.Threading.CancellationTokenSource.WaitForCallbackToComplete(System.Threading.CancellationCallbackInfo)
mscorlib_ni!System.Threading.CancellationTokenRegistration.Dispose()
mscorlib_ni!System.Threading.CancellationTokenSource.Dispose(Boolean)
System!System.Net.WebSockets.WebSocketBase+OutstandingOperationHelper.Dispose()
System!System.Net.WebSockets.WebSocketBase.CleanUp()
System!System.Net.WebSockets.WebSocketBase.Abort()
System!System.Net.WebSockets.WebSocketBase+<CloseOutputAsyncCore>d__17.MoveNext()
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.__Canon, mscorlib]](System.__Canon ByRef)
System!System.Net.WebSockets.WebSocketBase.CloseOutputAsyncCore(System.Net.WebSockets.WebSocketCloseStatus, System.String, System.Threading.CancellationToken)
System!System.Net.WebSockets.WebSocketBase.CloseOutputAsync(System.Net.WebSockets.WebSocketCloseStatus, System.String, System.Threading.CancellationToken)
System!System.Net.WebSockets.ClientWebSocket.CloseOutputAsync(System.Net.WebSockets.WebSocketCloseStatus, System.String, System.Threading.CancellationToken)
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.WebSockets.WebSocketHandler.<CloseAsync>b__3()
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.Infrastructure.TaskQueue.<Enqueue>b__1(System.Func`1<System.Threading.Tasks.Task>)
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod[[System.__Canon, mscorlib],[System.__Canon, mscorlib]](System.Func`2<System.__Canon,System.__Canon>, System.__Canon)
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.TaskAsyncHelper.Then[[System.__Canon, mscorlib]](System.Threading.Tasks.Task, System.Func`2<System.__Canon,System.Threading.Tasks.Task>, System.__Canon)
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.Infrastructure.TaskQueue.Enqueue(System.Func`1<System.Threading.Tasks.Task>)
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.WebSockets.WebSocketHandler.CloseAsync()
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.WebSockets.WebSocketHandler+<ProcessWebSocketRequestAsync>d__9.MoveNext()
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
mscorlib_ni!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
mscorlib_ni!System.Threading.Tasks.Task.FinishContinuations()
mscorlib_ni!System.Threading.Tasks.Task.FinishStageThree()
mscorlib_ni!System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetCanceled(System.Threading.CancellationToken, System.Object)
mscorlib_ni!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].SetException(System.Exception)
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.WebSockets.WebSocketMessageReader+<ReadMessageAsync>d__0.MoveNext()
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
mscorlib_ni!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
mscorlib_ni!System.Threading.Tasks.Task.FinishContinuations()
mscorlib_ni!System.Threading.Tasks.Task.FinishStageThree()
mscorlib_ni!System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetCanceled(System.Threading.CancellationToken, System.Object)
mscorlib_ni!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].SetException(System.Exception)
System!System.Net.WebSockets.WebSocketBase+<ReceiveAsyncCore>d__1.MoveNext()
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
mscorlib_ni!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
mscorlib_ni!System.Threading.Tasks.Task.FinishContinuations()
mscorlib_ni!System.Threading.Tasks.Task.FinishStageThree()
mscorlib_ni!System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetCanceled(System.Threading.CancellationToken, System.Object)
mscorlib_ni!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].SetException(System.Exception)
System!System.Net.WebSockets.WebSocketBase+WebSocketOperation+<Process>d__47.MoveNext()
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
mscorlib_ni!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
mscorlib_ni!System.Threading.Tasks.Task.FinishContinuations()
mscorlib_ni!System.Threading.Tasks.Task.FinishStageThree()
mscorlib_ni!System.Threading.Tasks.Task.CancellationCleanupLogic()
mscorlib_ni!System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetCanceled(System.Threading.CancellationToken, System.Object)
mscorlib_ni!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].SetException(System.Exception)
System!System.Net.WebSockets.WebSocketConnectionStream+<ReadAsync>d__c.MoveNext()
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
mscorlib_ni!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
mscorlib_ni!System.Threading.Tasks.Task.FinishContinuations()
mscorlib_ni!System.Threading.Tasks.Task.FinishStageThree()
mscorlib_ni!System.Threading.Tasks.Task.FinishStageTwo()
mscorlib_ni!System.Threading.Tasks.Task.Finish(Boolean)
mscorlib_ni!System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetException(System.Object)
mscorlib_ni!System.Threading.Tasks.TaskCompletionSource`1[[System.__Canon, mscorlib]].TrySetException(System.Exception)
System!System.Net.WebSockets.WebSocketConnectionStream+WebSocketConnection.OnReadCompleted(System.Object, System.Net.Sockets.SocketAsyncEventArgs)
System!System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(System.Net.Sockets.SocketAsyncEventArgs)
System!System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
System!System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncFailure(System.Net.Sockets.SocketError, Int32, System.Net.Sockets.SocketFlags)
System!System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
mscorlib_ni!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
clr
clr!DllRegisterServerInternal
clr!DllRegisterServerInternal
clr!DllGetClassObjectInternal
clr!LogHelp_TerminateOnAssert
clr!LogHelp_TerminateOnAssert
clr!LogHelp_TerminateOnAssert
clr!DllGetClassObjectInternal
clr!DllGetClassObjectInternal
clr!DllGetClassObjectInternal
clr!LogHelp_TerminateOnAssert
clr!LogHelp_TerminateOnAssert
clr!DllUnregisterServerInternal
clr!DllGetClassObjectInternal
clr!DllGetClassObjectInternal
clr!GetMetaDataInternalInterfaceFromPublic
clr!DllGetClassObjectInternal
KERNEL32!BaseThreadInitThunk
ntdll!RtlInitializeExceptionChain
ntdll!RtlInitializeExceptionChain
WARNING: Stack unwind information not available. Following frames may be wrong.
ntdll!ZwWaitForMultipleObjects
USER32!MsgWaitForMultipleObjectsEx
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\SYSTEM32\combase.dll - 
USER32!MsgWaitForMultipleObjectsEx
combase!CLSIDFromString
combase!CoWaitForMultipleHandles
combase!CoWaitForMultipleHandles
clr!DllGetClassObjectInternal
clr!DllGetClassObjectInternal
clr!PreBindAssemblyEx
clr!PreBindAssemblyEx
clr!LogHelp_TerminateOnAssert
clr!GetMetaDataInternalInterfaceFromPublic
clr!GetMetaDataInternalInterfaceFromPublic
clr!GetMetaDataInternalInterfaceFromPublic
*** ERROR: Module load completed but symbols could not be loaded for System.dll
System!System.Net.WebSockets.WebSocketBase.TakeLocks(Boolean ByRef, Boolean ByRef)
System!System.Net.WebSockets.WebSocketBase.Abort()
System!System.Net.WebSockets.WebSocketBase+<ReceiveAsyncCore>d__1.MoveNext()
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
mscorlib_ni!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
mscorlib_ni!System.Threading.Tasks.Task.FinishContinuations()
mscorlib_ni!System.Threading.Tasks.Task.FinishStageThree()
mscorlib_ni!System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetCanceled(System.Threading.CancellationToken, System.Object)
mscorlib_ni!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].SetException(System.Exception)
System!System.Net.WebSockets.WebSocketBase+WebSocketOperation+<Process>d__47.MoveNext()
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
mscorlib_ni!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
mscorlib_ni!System.Threading.Tasks.Task.FinishContinuations()
mscorlib_ni!System.Threading.Tasks.Task.FinishStageThree()
mscorlib_ni!System.Threading.Tasks.Task.CancellationCleanupLogic()
mscorlib_ni!System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetCanceled(System.Threading.CancellationToken, System.Object)
mscorlib_ni!System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].SetException(System.Exception)
System!System.Net.WebSockets.WebSocketConnectionStream+<ReadAsync>d__c.MoveNext()
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
mscorlib_ni!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
mscorlib_ni!System.Threading.Tasks.Task.FinishContinuations()
mscorlib_ni!System.Threading.Tasks.Task.FinishStageThree()
mscorlib_ni!System.Threading.Tasks.Task.CancellationCleanupLogic()
mscorlib_ni!System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetCanceled(System.Threading.CancellationToken, System.Object)
mscorlib_ni!System.Threading.Tasks.TaskCompletionSource`1[[System.__Canon, mscorlib]].TrySetCanceled(System.Threading.CancellationToken)
System!System.Net.WebSockets.WebSocketConnectionStream+WebSocketConnection.OnCancel(System.Object)
System!System.Net.WebSockets.WebSocketConnectionStream.CancelWebSocketConnection()
System!System.Net.WebSockets.WebSocketConnectionStream.OnCancel(System.Object)
mscorlib_ni!System.Threading.CancellationCallbackInfo.ExecutionContextCallback(System.Object)
mscorlib_ni!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
mscorlib_ni!System.Threading.CancellationCallbackInfo.ExecuteCallback()
mscorlib_ni!System.Threading.CancellationTokenSource.CancellationCallbackCoreWork(System.Threading.CancellationCallbackCoreWorkArguments)
mscorlib_ni!System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean)
mscorlib_ni!System.Threading.CancellationTokenSource.NotifyCancellation(Boolean)
mscorlib_ni!System.Threading.CancellationTokenSource.LinkedTokenCancelDelegate(System.Object)
mscorlib_ni!System.Threading.CancellationCallbackInfo.ExecutionContextCallback(System.Object)
mscorlib_ni!System.Threading.CancellationCallbackInfo.ExecuteCallback()
mscorlib_ni!System.Threading.CancellationTokenSource.CancellationCallbackCoreWork(System.Threading.CancellationCallbackCoreWorkArguments)
mscorlib_ni!System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean)
mscorlib_ni!System.Threading.CancellationTokenSource.NotifyCancellation(Boolean)
*** WARNING: Unable to verify checksum for Microsoft.AspNet.SignalR.Client.dll
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.Infrastructure.SafeCancellationTokenSource.Cancel()
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.Client.Connection.Disconnect()
Microsoft_AspNet_SignalR_Client!Microsoft.AspNet.SignalR.Client.Connection.Stop()
*** WARNING: Unable to verify checksum for Microsoft.AspNet.SignalR.FunctionalTests.dll
Microsoft_AspNet_SignalR_FunctionalTests!Microsoft.AspNet.SignalR.Tests.PersistentConnectionFacts+SendFacts.SendToAllButCaller(Microsoft.AspNet.SignalR.FunctionalTests.Infrastructure.HostType, Microsoft.AspNet.SignalR.FunctionalTests.Infrastructure.TransportType)
clr
@davidfowl davidfowl was assigned Dec 11, 2012
@davidfowl
SignalR member

Fixed in aa80fc0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment