Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Analytics.Internal.BufferX.ClearBuffer causes an ArgumentException

Discussion in 'Unity Analytics' started by YD_JMysior, Oct 9, 2023.

  1. YD_JMysior


    Aug 4, 2016
    After switching my project to the analytics 5.0.0 package I got the following crash from the CloudDiagnostic:

    ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

    Managed Stack Trace:
    Code (csharp):
    1. Managed Stack Trace:
    2. System.Collections.Generic.List`1[T].RemoveRange (System.Int32 index, System.Int32 count) (at <9d9536d9127f4a489d989c7a566aee1c>:0)
    3. Unity.Services.Analytics.Internal.BufferX.ClearBuffer (System.Int64 upTo) (at <cac68f5af87e4ffbb5b62c6b20719ad1>:0)
    4. Unity.Services.Analytics.Internal.Dispatcher.UploadCompleted (System.Int64 responseCode) (at <cac68f5af87e4ffbb5b62c6b20719ad1>:0)
    5. Unity.Services.Analytics.Internal.WebRequestHelper+<>c__DisplayClass2_0.<SendWebRequest>b__0 (UnityEngine.AsyncOperation <p0>) (at <cac68f5af87e4ffbb5b62c6b20719ad1>:0)
    6. UnityEngine.AsyncOperation.InvokeCompletionEvent () (at <aa8a130777a0452aba2a2ed77148f1da>:0)


    Unfortunately, I cannot provide any more info on the context. Don't know what the end-user did to cause this. Anyway the Bufffer class probably should include some sort of failsafe for this.
  2. unity_Ctri


    Unity Technologies

    Oct 20, 2020
    Hey there,

    Thanks for this report. Our engineers were able to verify it and put in a bug fix for 5.0.1
    That's working it's way through the release pipeline, and that would normally mean it's availabe later this week.

    There may be unforeseen delays with that, but hopefully all will be well and you'll be able to carry on without this bug occurring.