NullReferenceException in Hammock during timeline refresh

Issue #8 resolved
Travis Illig
created an issue
Using the latest Halfwit, Halfwit crashed with a NullReferenceException while the timeline was being refreshed. I didn't have the source at the time so I couldn't get an actual line number, but I did hit the debugger to grab the stack trace. At the time I wasn't actually doing anything, though moments before I had been scrolling up and down the main timeline. {{{ at Hammock.RestClient.CompleteWithQuery[T](RestRequest request, WebQuery query, RestCallback`1 callback, RestResponse`1 response, WebQueryAsyncResult result) at Hammock.RestClient.CompleteWithQuery[T](WebQuery query, RestRequest request, RestCallback`1 callback, WebQueryAsyncResult result) at Hammock.RestClient.<>c__DisplayClass2e`1.<BeginRequestImpl>b__2b(Object sender, WebQueryResponseEventArgs args) at System.EventHandler`1.Invoke(Object sender, TEventArgs e) at Hammock.Web.WebQuery.OnQueryResponse(WebQueryResponseEventArgs args) at Hammock.Web.WebQuery.HandleWebException(WebException exception) at Hammock.Web.WebQuery.GetAsyncResponseCallback(IAsyncResult asyncResult) at System.Net.LazyAsyncResult.Complete(IntPtr userToken) at System.Net.ContextAwareResult.CompleteCallback(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Net.ContextAwareResult.Complete(IntPtr userToken) at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken) at System.Net.HttpWebRequest.SetResponse(Exception E) at System.Net.HttpWebRequest.Abort(Exception exception, Int32 abortState) at System.Net.HttpWebRequest.Abort() at System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting) at System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(CloseExState closeState) at System.Net.ConnectStream.CloseInternal(Boolean internalCall) at System.Net.HttpWebRequest.EndWriteHeaders_Part2() at System.Net.HttpWebRequest.EndWriteHeaders(Boolean async) at System.Net.HttpWebRequest.WriteHeadersCallback(WebExceptionStatus errorStatus, ConnectStream stream, Boolean async) at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar) at System.Net.LazyAsyncResult.Complete(IntPtr userToken) at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken) at System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.WriteCallback(IAsyncResult transportResult) at System.Net.LazyAsyncResult.Complete(IntPtr userToken) at System.Net.ContextAwareResult.CompleteCallback(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Net.ContextAwareResult.Complete(IntPtr userToken) at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken) at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) }}}

Comments (4)

  1. Matt Hamilton repo owner

    If you didn't post it, I was going to. :)

    Sadly this looks like a bug in Hammock. I've built the latest Hammock source code from scratch (which has a few bug fixes in it) and published a new version, and it seems a bit more solid, but I still see an "Assertion Failed" dialog once in a while.

    I'm not sure what else to do except roll back to the previous version and lose the media entity features I just added. Your thoughts?

  2. Travis Illig reporter

    Good question. I like the little thumbnail thing, that's slick.

    Is there a way to wrap the call so if you get the NullReferenceException you can just have it try again? There are some things in Halfwit where it will sort of "fail silently" and just display the error message in the status bar at the bottom. Could it be handled like that?

    (Sort of ignorant about exactly what's going on behind the scenes so I'm just throwing out ideas.)

  3. Matt Hamilton repo owner

    I'll check it out. I use TweetSharp's async method calls so I think a lot of these exceptions are being thrown either in a background thread or in the code that executes just before my callback gets fired. Perhaps I need an Application.OnException sort of thing - a global handler.

  4. Log in to comment