Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2983

BinaryDecoder on NetStandard 2.1+ Fails To Read Large Strings

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.11.0, 1.10.2
    • Component/s: csharp
    • Labels:
      None
    • Environment:

      netstandard2.1+

      Description

      In 1.10.0 support was added to use ArrayPool<byte>.Shared.Rent and ArrayPool<byte>.Shared.Return to get a buffer from the system. 

      ArrayPool<T>.Rent(Int32) returns a buffer that is at least minimumLength in length, but can be more.

      The span that is used is Read into until it isEmpty, and when this buffer returned from ArrayPool is not exactly the same as the requested minimumLength this causes an exception

        Message: 
          Avro.AvroException : End of stream reached
        Stack Trace: 
          BinaryDecoder.Read(Span`1 buffer) line 97
          BinaryDecoder.ReadString() line 74 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bryjeep Brian Davidson
                Reporter:
                bryjeep Brian Davidson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: