Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock in .NET client websocket stop logic #1120

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

Deadlock in .NET client websocket stop logic #1120

davidfowl opened this issue Dec 11, 2012 · 1 comment
Assignees
Milestone

Comments

@davidfowl
Copy link
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
@ghost ghost assigned davidfowl Dec 11, 2012
@davidfowl
Copy link
Member Author

Fixed in aa80fc0

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

No branches or pull requests

2 participants