question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StackOverflow Exception - Specific Avro Messages - Apache Avro 1.10.0

See original GitHub issue

Description

When upgrading to Confluent Kafka 1.5.0 from 1.3.0, for our separate Avro message projects, we upgraded the Avro messages projects to use Apache.Avro version 1.10.0 from Confluent.Kafka.Avro -> 1.7.7.7. At the time I noted that the minimum version of the dependency should be 1.9.2, but went with latest here. This has been fine so far but for this specific message I noticed StackOverflow exceptions in the consumer.

For a specific avro type we have:

{ 
  "namespace": "[namespace]",
  "type": "record",
  "doc": "[doc]",
  "name": "[message]",
  "fields": [
		{
			"name": "Field1",
			"type": "string"
		},
		{
			"name": "Field2",
			"type": "string"
		},
    {
      "name": "Field3",
      "type": "string"
    }
  ]
}

One thing to note is the strings in the fields will be quite large. I can try and get exact sizes if this helps.

When specifically targeting Apache.Avro 1.10.0 the following happens:

>	Avro.dll!Avro.IO.BinaryDecoder.ReadString()	Unknown
 	Avro.dll!Avro.Generic.DefaultReader.Read<System.__Canon>(Avro.Schema.Type tag, Avro.Schema readerSchema, Avro.Generic.Reader<System.__Canon> reader)	Unknown
 	Avro.dll!Avro.Generic.DefaultReader.Read(object reuse, Avro.Schema writerSchema, Avro.Schema readerSchema, Avro.IO.Decoder d)	Unknown
 	Avro.dll!Avro.Specific.SpecificDefaultReader.ReadRecord(object reuse, Avro.RecordSchema writerSchema, Avro.Schema readerSchema, Avro.IO.Decoder dec)	Unknown
 	Avro.dll!Avro.Generic.DefaultReader.Read(object reuse, Avro.Schema writerSchema, Avro.Schema readerSchema, Avro.IO.Decoder d)	Unknown
 	Avro.dll!Avro.Generic.DefaultReader.Read<>( reuse, Avro.IO.Decoder decoder)	Unknown
 	Avro.dll!Avro.Specific.SpecificReader<>.Read( reuse, Avro.IO.Decoder dec)	Unknown
 	Confluent.SchemaRegistry.Serdes.Avro.dll!Confluent.SchemaRegistry.Serdes.SpecificDeserializerImpl<>.Deserialize(string topic, byte[] array)	Unknown

How to reproduce

  • Create a consumer with default settings. I used the Apache Avro Example from the repo as my basis
  • Create a AVRO message with large strings
  • Reference Apache Avro 1.10.0 rather than 1.9.2

Should we use the latest Apache.Avro version? I have a lot more complex Avro messages targeting this version and working fine thus far. The only thing I can think of is the large strings?

Checklist

Please provide the following information:

  • A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
  • [1.5.0] Confluent.Kafka nuget version.
  • Apache Kafka version.
  • Client configuration.
  • [Windows+Linux] Operating system.
  • Provide logs (with “debug” : “…” as necessary in configuration).
  • Provide broker log excerpts.
  • [] Critical issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
marek-vranacommented, Jan 4, 2021

Currently there are two open bugs related to our investigation:

let’s hope for a soonish fix for the first one at least 🤞

2reactions
marek-vranacommented, Mar 18, 2021

FYI: version 1.10.2 is out 🎉 large strings issue is fixed. https://github.com/apache/avro/releases/tag/release-1.10.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting exception while sending avro message ...
1 Answer. I was able to publish the message in AVRO format successfully, Though, the above configuration and properties are enough for ...
Read more >
Apache Avro™ 1.10.0 Specification
Apache Avro ™ 1.10.0 Specification. Introduction; Schema Declaration. Primitive Types; Complex Types. Records; Enums; Arrays; Maps; Unions; Fixed.
Read more >
Apache Avro™ 1.10.2 Specification
This document defines Apache Avro. It is intended to be the authoritative specification. Implementations of Avro must adhere to this document.
Read more >
Specification - Apache Avro
Specification. 39 minute read. Introduction. This document defines Apache Avro. It is intended to be the authoritative specification.
Read more >
[#AVRO-3225] StackOverflowException on invalid input for ...
The BinaryDecoder.ReadString() method on NetStandard2.1+ produces a stack overflow exception if there is invalid input caused by this code: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found