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

Obscure NullReferenceException if server does not provide a Content-Type header in polling transport #18

Open
vsoldatkin opened this issue Jan 23, 2016 · 4 comments

Comments

@vsoldatkin
Copy link

You'll get a null reference here: https://github.com/Quobject/EngineIoClientDotNet/blob/master/Src/EngineIoClientDotNet.mono/Client/Transports/PollingXHR.cs#L328

It is accessed later in an octet-stream check producing a NullReferenceException which is quite hard to grasp using a release nuget build.

@mattqs
Copy link
Contributor

mattqs commented Jan 23, 2016

Why is it hard to grasp?

@mattqs mattqs closed this as completed Jan 23, 2016
@vsoldatkin
Copy link
Author

If someone uses a release build published in nuget he gets no info about the exception at all, which makes it impossible to know what exatcly went wrong and how one should fix that.

Aside of that, do you by closing this issue mean you don't acknowlege this as a bug? I'm not talking about the obscurity, it is about the exception while processing the response with no header. Note that Content-Type header is optional.

@mattqs
Copy link
Contributor

mattqs commented Jan 23, 2016

OK, Reopened. Please provide a stacktrace.

@mattqs mattqs reopened this Jan 23, 2016
@vsoldatkin
Copy link
Author

This is what the immediate call stack looks like (via IntelliTrace):

>   EngineIoClientDotNet.dll!XHRRequest.AnonymousMethod()   
    mscorlib.dll!System.Threading.Tasks.Task.InnerInvoke()  
    mscorlib.dll!System.Threading.Tasks.Task.Execute()  
    mscorlib.dll!System.Threading.Tasks.Task.ExecutionContextCallback(object obj = {unknown})   
    mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext = {unknown}, System.Threading.ContextCallback callback = {unknown}, object state = {unknown}, bool preserveSyncCtx = {unknown})   
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext = {unknown}, System.Threading.ContextCallback callback = {unknown}, object state = {unknown}, bool preserveSyncCtx = {unknown})   
    mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot = {unknown})    
    mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution = {unknown}) 
    mscorlib.dll!System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() 
    mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()    
    mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() 

Here is an error message from the Socket.IO connect_error handler:

Quobject.EngineIoClientDotNet.Client.EngineIOException: xhr poll error ---> System.AggregateException ---> System.NullReferenceException
   в Quobject.EngineIoClientDotNet.Client.Transports.PollingXHR.XHRRequest.<Create>b__2()
   в System.Threading.Tasks.Task.InnerInvoke()
   в System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   в System.Threading.Tasks.Task.Wait()
   в Quobject.EngineIoClientDotNet.Client.Transports.PollingXHR.XHRRequest.Create()
   --- End of inner exception stack trace ---

Not really informative, aren't they? The exact cause is provided in the first post.

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

No branches or pull requests

2 participants