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

Stack Overflow Exception version 2.1.1 #3228

Closed
AlexisColes opened this issue Aug 19, 2014 · 8 comments
Closed

Stack Overflow Exception version 2.1.1 #3228

AlexisColes opened this issue Aug 19, 2014 · 8 comments
Assignees
Milestone

Comments

@AlexisColes
Copy link

Hi there,

I wish I could give you more information about this but after upgrading our project to version 2.1.1 I started getting a stackOverFlow exception.

Seemed to be calling some method on the hub called set_Clients() over and over again.

I rolled back the version of the project to version 2.0.3 and now all seems to be well again.

Cheers

@RonaldWeng
Copy link

Have the same issue, when I attempt to initialise Hubs.cs it goes into a infinite loop

@halter73
Copy link
Member

@AlexisColes @RonaldWeng Can either of you post the complete stack trace? Also, what version of SignalR were you upgrading from? Thanks.

@RonaldWeng
Copy link

Hi, the version I used was 2.0.2 I just upgraded to 2.1.1, SignalR connects fine but when you attempt from the client to submit login message request to the server I get the StackOverflow error

I've tested the server side components where I have a my security service class that inherits the Hubs library - the only difference I found in the inherited file now is I no longer see the onConnection and Disconnected methods I see protected Hub();
:

#region Assembly Microsoft.AspNet.SignalR.Core.dll, v2.1.1.0
// C:\Development\V1\Binaries\3rdParty\Microsoft\SignalR\2.1.1\Microsoft.AspNet.SignalR.Core.dll
#endregion

using Microsoft.AspNet.SignalR.Hubs;

namespace Microsoft.AspNet.SignalR
{
// Summary:
// Provides methods that communicate with SignalR connections that connected
// to a Microsoft.AspNet.SignalR.Hub.
public abstract class Hub : HubBase
{
protected Hub();

    public IHubCallerConnectionContext<dynamic> Clients { get; set; }
}

}

When I make a call to the class constructor I get the error:

An unhandled exception of type 'System.StackOverflowException' occurred in "SecurityService.dll"

P.S Are you asking for the log file: u_ex140820.log and fr000001.xml logs?

#Software: Microsoft Internet Information Services 8.0
#Version: 1.0
#Date: 2014-08-20 13:36:06
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2014-08-20 13:36:06 ::1 DEBUG /KomodoUI.MiddleTier/debugattach.aspx - 80 - ::1 - - 401 0 0 4
2014-08-20 13:36:10 ::1 GET /KomodoUI.MiddleTier/ - 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 - 200 0 0 696
2014-08-20 13:37:23 ::1 GET /KomodoUI.MiddleTier/signalr/hubs - 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 - 200 0 0 100
2014-08-20 13:37:23 ::1 GET /KomodoUI.MiddleTier/signalr/negotiate clientProtocol=1.4&connectionData=%5B%7B%22name%22%3A%22cachedfilehub%22%7D%2C%7B%22name%22%3A%22logginghub%22%7D%5D&_=1408541826734 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 http://localhost:51944/ 200 0 0 35
2014-08-20 13:37:25 ::1 GET /KomodoUI.MiddleTier/signalr/connect transport=longPolling&clientProtocol=1.4&connectionToken=EY97pssdiQxX0jVnD%2F%2B7YFs%2FrI0079gN%2B6R1Vligz%2BWOIsHsH6cZ54ZoqoSM42OlfPOgEYkZtT5DGkVlqfpwogOjGSF1r49OgF2ae4warNmCfUVHVOKb6XwLUxGCLZ9%2B&connectionData=%5B%7B%22name%22%3A%22cachedfilehub%22%7D%2C%7B%22name%22%3A%22logginghub%22%7D%5D&tid=6&_=1408541826743 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 http://localhost:51944/ 200 0 0 211
2014-08-20 13:37:25 ::1 GET /KomodoUI.MiddleTier/signalr/start transport=longPolling&clientProtocol=1.4&connectionToken=EY97pssdiQxX0jVnD%2F%2B7YFs%2FrI0079gN%2B6R1Vligz%2BWOIsHsH6cZ54ZoqoSM42OlfPOgEYkZtT5DGkVlqfpwogOjGSF1r49OgF2ae4warNmCfUVHVOKb6XwLUxGCLZ9%2B&connectionData=%5B%7B%22name%22%3A%22cachedfilehub%22%7D%2C%7B%22name%22%3A%22logginghub%22%7D%5D&_=1408541826744 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 http://localhost:51944/ 200 0 0 187
2014-08-20 13:37:59 ::1 DEBUG /KomodoUI.MiddleTier/debugattach.aspx - 80 - ::1 - - 200 0 0 4845
2014-08-20 13:37:59 ::1 GET /KomodoUI.MiddleTier/signalr/reconnect transport=longPolling&messageId=d-2A838DCF-G%2C0%7CH%2C0%7CI%2C0%7CJ%2C0%7CK%2C1%7CL%2C0&clientProtocol=1.4&connectionToken=EY97pssdiQxX0jVnD%2F%2B7YFs%2FrI0079gN%2B6R1Vligz%2BWOIsHsH6cZ54ZoqoSM42OlfPOgEYkZtT5DGkVlqfpwogOjGSF1r49OgF2ae4warNmCfUVHVOKb6XwLUxGCLZ9%2B&connectionData=%5B%7B%22name%22%3A%22cachedfilehub%22%7D%2C%7B%22name%22%3A%22logginghub%22%7D%5D&tid=7&_=1408541826772 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 http://localhost:51944/ 200 0 0 2297
2014-08-20 13:38:01 ::1 POST /KomodoUI.MiddleTier/signalr/send transport=longPolling&clientProtocol=1.4&connectionToken=EY97pssdiQxX0jVnD%2F%2B7YFs%2FrI0079gN%2B6R1Vligz%2BWOIsHsH6cZ54ZoqoSM42OlfPOgEYkZtT5DGkVlqfpwogOjGSF1r49OgF2ae4warNmCfUVHVOKb6XwLUxGCLZ9%2B&connectionData=%5B%7B%22name%22%3A%22cachedfilehub%22%7D%2C%7B%22name%22%3A%22logginghub%22%7D%5D 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 http://localhost:51944/ 200 0 0 6707
2014-08-20 13:38:01 ::1 GET /KomodoUI.MiddleTier/signalr/poll transport=longPolling&messageId=d-ABA932E8-A%2C0%7CB%2C0%7CC%2C0%7CD%2C2%7CE%2C0%7CF%2C0&clientProtocol=1.4&connectionToken=EY97pssdiQxX0jVnD%2F%2B7YFs%2FrI0079gN%2B6R1Vligz%2BWOIsHsH6cZ54ZoqoSM42OlfPOgEYkZtT5DGkVlqfpwogOjGSF1r49OgF2ae4warNmCfUVHVOKb6XwLUxGCLZ9%2B&connectionData=%5B%7B%22name%22%3A%22cachedfilehub%22%7D%2C%7B%22name%22%3A%22logginghub%22%7D%5D&tid=0&_=1408541826783 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 http://localhost:51944/ 200 0 0 681
2014-08-20 13:38:01 ::1 POST /KomodoUI.MiddleTier/signalr/send transport=longPolling&clientProtocol=1.4&connectionToken=EY97pssdiQxX0jVnD%2F%2B7YFs%2FrI0079gN%2B6R1Vligz%2BWOIsHsH6cZ54ZoqoSM42OlfPOgEYkZtT5DGkVlqfpwogOjGSF1r49OgF2ae4warNmCfUVHVOKb6XwLUxGCLZ9%2B&connectionData=%5B%7B%22name%22%3A%22cachedfilehub%22%7D%2C%7B%22name%22%3A%22logginghub%22%7D%5D 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 http://localhost:51944/ 200 0 0 1517
2014-08-20 13:38:02 ::1 GET /KomodoUI.MiddleTier/signalr/poll transport=longPolling&messageId=d-ABA932E8-A%2C0%7CB%2C0%7CC%2C0%7CD%2CF3%7CE%2C0%7CF%2C0&clientProtocol=1.4&connectionToken=EY97pssdiQxX0jVnD%2F%2B7YFs%2FrI0079gN%2B6R1Vligz%2BWOIsHsH6cZ54ZoqoSM42OlfPOgEYkZtT5DGkVlqfpwogOjGSF1r49OgF2ae4warNmCfUVHVOKb6XwLUxGCLZ9%2B&connectionData=%5B%7B%22name%22%3A%22cachedfilehub%22%7D%2C%7B%22name%22%3A%22logginghub%22%7D%5D&tid=6&_=1408541826786 80 - ::1 Mozilla/5.0+(Windows+NT+6.2;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/36.0.1985.143+Safari/537.36 http://localhost:51944/ 200 0 0 214

@RonaldWeng
Copy link

The server_traces file:

Microsoft.Owin.Host.SystemWeb.OwinAppContext Information: 0 : Support for WebSockets has been detected.
Microsoft.Owin.Host.SystemWeb.OwinAppContext Information: 0 : Support for WebSockets has been detected.
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Information: 0 : End(0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Information: 0 : End(0d4beb77-2c0a-4838-a348-6c2830457f5c)
Microsoft.Owin.Host.SystemWeb.OwinAppContext Information: 0 : Support for WebSockets has been detected.
SignalR.Transports.LongPollingTransport Information: 0 : Abort(0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Information: 0 : End(0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Verbose: 0 : Cancel(0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (0d4beb77-2c0a-4838-a348-6c2830457f5c)
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : End(95ec2e1c-742c-456d-97f5-8ae18f91a711)
Microsoft.Owin.Host.SystemWeb.OwinAppContext Information: 0 : Support for WebSockets has been detected.
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : End(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : End(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : End(95ec2e1c-742c-456d-97f5-8ae18f91a711)
Microsoft.Owin.Host.SystemWeb.OwinAppContext Information: 0 : Support for WebSockets has been detected.
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : End(95ec2e1c-742c-456d-97f5-8ae18f91a711)
Microsoft.Owin.Host.SystemWeb.OwinAppContext Information: 0 : Support for WebSockets has been detected.
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : End(95ec2e1c-742c-456d-97f5-8ae18f91a711)
Microsoft.Owin.Host.SystemWeb.OwinAppContext Information: 0 : Support for WebSockets has been detected.
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : End(95ec2e1c-742c-456d-97f5-8ae18f91a711)
Microsoft.Owin.Host.SystemWeb.OwinAppContext Information: 0 : Support for WebSockets has been detected.
SignalR.Transports.LongPollingTransport Verbose: 0 : DrainWrites(95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : CompleteRequest (95ec2e1c-742c-456d-97f5-8ae18f91a711)
SignalR.Transports.LongPollingTransport Information: 0 : End(95ec2e1c-742c-456d-97f5-8ae18f91a711)

DefaultTraces file:

w3wp.exe Warning: 0 : SignalR exception thrown by Task: System.AggregateException: One or more errors occurred. ---> System.Web.HttpException: The remote host closed the connection. The error code is 0x800704CD.
   at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
   at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
   at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
   at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
   at Microsoft.Owin.Host.SystemWeb.CallStreams.DelegatingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.Owin.Host.SystemWeb.CallStreams.OutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.AspNet.SignalR.Owin.ServerResponse.Write(ArraySegment`1 data)
   at Microsoft.AspNet.SignalR.Infrastructure.BinaryTextWriter.<.ctor>b__4(ArraySegment`1 data, Object state)
   at Microsoft.AspNet.SignalR.Infrastructure.BufferTextWriter.ChunkedWriter.Flush(Byte[] byteBuffer, Boolean flushEncoder)
   at Microsoft.AspNet.SignalR.Infrastructure.BufferTextWriter.Flush()
   at Microsoft.AspNet.SignalR.Transports.LongPollingTransport.PerformPartialSend(Object state)
   at Microsoft.AspNet.SignalR.Infrastructure.TaskQueue.InvokeNext(Func`2 next, Object nextState, Object queueState)
   at Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod[T1,T2,T3](Func`4 func, T1 arg1, T2 arg2, T3 arg3)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.SignalR.Messaging.Subscription.<Invoke>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.SignalR.Messaging.Subscription.<Work>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.SignalR.Messaging.MessageBroker.<DoWork>d__2.MoveNext()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Web.HttpException (0x800704CD): The remote host closed the connection. The error code is 0x800704CD.
   at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
   at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
   at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
   at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
   at Microsoft.Owin.Host.SystemWeb.CallStreams.DelegatingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.Owin.Host.SystemWeb.CallStreams.OutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.AspNet.SignalR.Owin.ServerResponse.Write(ArraySegment`1 data)
   at Microsoft.AspNet.SignalR.Infrastructure.BinaryTextWriter.<.ctor>b__4(ArraySegment`1 data, Object state)
   at Microsoft.AspNet.SignalR.Infrastructure.BufferTextWriter.ChunkedWriter.Flush(Byte[] byteBuffer, Boolean flushEncoder)
   at Microsoft.AspNet.SignalR.Infrastructure.BufferTextWriter.Flush()
   at Microsoft.AspNet.SignalR.Transports.LongPollingTransport.PerformPartialSend(Object state)
   at Microsoft.AspNet.SignalR.Infrastructure.TaskQueue.InvokeNext(Func`2 next, Object nextState, Object queueState)
   at Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod[T1,T2,T3](Func`4 func, T1 arg1, T2 arg2, T3 arg3)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.SignalR.Messaging.Subscription.<Invoke>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.SignalR.Messaging.Subscription.<Work>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNet.SignalR.Messaging.MessageBroker.<DoWork>d__2.MoveNext()<---

@davidfowl
Copy link
Member

I don't see a stack overflow exception anywhere in here. What makes you think that the exception is in SignalR itself?

@tomi85
Copy link

tomi85 commented Oct 21, 2014

I've got the same problem. This happens when the concrete hub re-implement (directly or indirectly) the interface IHub. So, the property setter "Clients" of Hub class is called by himself.

@halter73
Copy link
Member

@tomi85 Thanks!

Just to restate what you've said: if you have MyHub : Hub, IHub and then try using the Clients property, you will get a StackOverflowException which will, of course, crash the process.

This is the result of how the Clients property is implemented in Hub.cs. Basically Hub.Clients just calls through to IHub.Clients. If you specify that your concrete Hub implements IHub, Hub.Clients will start implementing IHub.Clients and call itself.

@GrabYourPitchforks has suggested we could avoid this issue by calling through to a Clients property defined on an internal interface. Alternatively, we could call into an equivalent internal property with a different name.

@tomi85 Is there any reason you are re-implementing IHub?

@tomi85
Copy link

tomi85 commented Oct 22, 2014

No. It was just for convenience. I have my own implementation of IHubActivator which resolve hub differently when hubtype implements IOwnedHub. This interface implemented IHub.

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

5 participants