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

C# infinite recursion in IConvertible.ToByte(System.IFormatProvider) of AvroDecimal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.11.0
    • None
    • csharp, logical types
    • None
    • .NET SDK 6.0.301 on Windows 10 x64

    Description

      To reproduce

      using System;
      using Avro;
      
      class Program
      {
          static void Main()
          {
              Convert.ToByte(new AvroDecimal(0));
          }
      }
      

      Expected result

      Convert.ToByte returns (byte)0, and the program does not output anything.

      Actual result

      Stack overflow.
      Repeat 13759 times:
      --------------------------------
         at Avro.AvroDecimal.System.IConvertible.ToByte(System.IFormatProvider)
         at System.Convert.ToByte(System.Object, System.IFormatProvider)
      --------------------------------
         at Avro.AvroDecimal.System.IConvertible.ToByte(System.IFormatProvider)
         at System.Convert.ToByte(System.Object)
         at Program.Main()
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            kniemitalo Kalle Niemitalo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: