peterhaneve/evemon

Repeated crashes

Closed this issue · 1 comments

EVEMon never crashed on me for months, but I started using the Assets feature ~2 weeks ago (without upgrading EVEMon) and I've just had my ~3rd crash.

Happy to help debug but I'm trying to post only an anonymized log first.

EVEMon Version: 4.0.19.4983
.NET Runtime Version: 4.0.30319.42000
Operating System: Microsoft Windows NT 10.0.18363.0
Executable Path: "D:\Apps\EVEMon\EVEMon.exe" 
System.ArgumentOutOfRangeException: Index must be within the bounds of the List.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.Insert(Int32 index, T item)
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at EVEMon.CharacterMonitoring.CharacterAssetsList.<UpdateAssetLocationAsync>b__47_0()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at EVEMon.CharacterMonitoring.CharacterAssetsList.<UpdateAssetLocationAsync>d__47.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at EVEMon.CharacterMonitoring.CharacterAssetsList.<EveMonClient_ConquerableStationListUpdated>d__60.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()


Datafile report:
  eve-blueprints-en-US.xml.gzip (233KiB - 3a807bb1d48460c57e10ef7fddcaf619)
  eve-certificates-en-US.xml.gzip (45KiB - 540000f7c111354769a54fa31e57d411)
  eve-geography-en-US.xml.gzip (1007KiB - 3077e700023d84a267b744a6ee44acc7)
  eve-items-en-US.xml.gzip (3506KiB - 0abab62dde07fbf0bc8eafe0811c9d18)
  eve-masteries-en-US.xml.gzip (21KiB - 3668b50996fc40a0c0853fec427b5712)
  eve-properties-en-US.xml.gzip (55KiB - 93b8499c86acdad46607c697f221970a)
  eve-reprocessing-en-US.xml.gzip (114KiB - 46b56972972a308d90c153770ce46000)
  eve-skills-en-US.xml.gzip (25KiB - 84843e1f2e8946cb8f7f7588d2c72562)


Diagnostic Log:
0d 0h 00m 00s > Starting up
0d 0h 00m 00s > EveMonClient.Initialize - begin
0d 0h 00m 00s > Program.StartupAsync - done
0d 0h 00m 00s > Settings.TryDeserializeFromFile - begin
0d 0h 00m 00s > Settings.TryDeserializeFromFile - done
0d 0h 00m 00s > Settings.Import - begin
0d 0h 00m 00s > EveMonClient.OnSchedulerChanged
0d 0h 00m 00s > Settings.Import - done
0d 0h 00m 00s > EveMonClient.OnSettingsChanged
0d 0h 00m 00s > Main loop - start
0d 0h 00m 01s > MainWindow.OnLoad
0d 0h 00m 01s > TimeCheck.ScheduleCheck - in 00:00:01
0d 0h 00m 01s > UpdateManager.ScheduleCheck - in 00:00:10
0d 0h 00m 01s > Main window - loaded
0d 0h 00m 01s > Datafiles.Load - begin
0d 0h 00m 02s > TimeCheck.BeginCheckAsync
0d 0h 00m 02s > TimeCheck.OnCheckCompleted - Synchronised
0d 0h 00m 02s > TimeCheck.ScheduleCheck - in 1.00:00:00
0d 0h 00m 02s > EveMonClient.OnServerStatusUpdated
0d 0h 00m 06s > Datafiles.Load - done
0d 0h 00m 06s > Settings.ImportData - begin

[...]

0d 6h 03m 47s > EveMonClient.OnConquerableStationListUpdated
0d 6h 03m 49s > EveMonClient.OnNotificationSent - Error looking up citadel information.
0d 6h 03m 49s > EveMonClient.OnNotificationSent - Error looking up citadel information.
0d 6h 03m 49s > EveMonClient.OnNotificationSent - Error looking up citadel information.
0d 6h 03m 49s > EveMonClient.OnConquerableStationListUpdated
0d 6h 03m 49s > EveMonClient.OnConquerableStationListUpdated
0d 6h 03m 49s > EveMonClient.OnConquerableStationListUpdated
# log ends here.

After the first part the only exceptions are a bunch of these, and they're all caught, EVEMon doesn't crash:

    EVEMon.Common.Net.HttpWebClientServiceException: A request to login.eveonline.com failed with status: 400 (Bad Request). ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at EVEMon.Common.Net.HttpClientServiceRequest.EnsureSuccessStatusCode(HttpResponseMessage response)
   at EVEMon.Common.Net.HttpClientServiceRequest.<SendAsync>d__8.MoveNext()
   --- End of inner exception stack trace ---
   at EVEMon.Common.Net.HttpClientServiceRequest.<SendAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at EVEMon.Common.Net.HttpWebClientService.<DownloadStringAsync>d__2.MoveNext()
    
0d 6h 01m 02s > EveMonClient.OnNotificationSent - Error logging in to EVE SSO.

This issue appears to be a race condition in asset location updates. I added a lock in 10aaef3 which may resolve the issue.