rdavisau/sockets-for-pcl

Error: Unhandled Exception

Opened this issue · 1 comments

Hi, we are getting this crashlogs randomly in our application as it crashes. Why does this kind of error appear and how to fix this?

System.Exception: OnUnobservedTaskException ---> System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.Net.Sockets.SocketException: interrupted
at System.Net.Sockets.Socket.Accept () [0x00039] in :0
at System.Net.Sockets.TcpListener.AcceptTcpClient () [0x00016] in :0
at Sockets.Plugin.TcpSocketListener.b__12_1 () [0x00000] in <2f138e7b68e347c9af2254c98d7ec989>:0
at System.Threading.Tasks.Task1[TResult].InnerInvoke () [0x00012] in <3dc9ed3d31194319991e686734adcb10>:0 at System.Threading.Tasks.Task.Execute () [0x00016] in <3dc9ed3d31194319991e686734adcb10>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <3dc9ed3d31194319991e686734adcb10>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <3dc9ed3d31194319991e686734adcb10>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <3dc9ed3d31194319991e686734adcb10>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <3dc9ed3d31194319991e686734adcb10>:0 at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <3dc9ed3d31194319991e686734adcb10>:0
at Sockets.Plugin.TcpSocketListener+<>c__DisplayClass12_0+<b__0>d.MoveNext () [0x00083] in <2f138e7b68e347c9af2254c98d7ec989>:0
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---

Hi, are you by chance using an old version of HockeyApp? Unobserved task exceptions should not cause the app to be torn down but in old versions of hockeyapp that was the case - bitstadium/HockeySDK-Xamarin#14 for some context, bitstadium/HockeySDK-Xamarin#61 for where the change was made. It's some time ago, so I don't remember whether the default was changed. You may need to set CrashManager.TerminateOnUnobservedTaskException to false.

If you are not using hockeyapp, it may be that another crash reporter is rethrowing or maybe an internal library?