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

C++ generator for recursive structure crashes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.1
    • None
    • c++
    • None

    Description

      I was testing out a Avro specification for a tree type and the generator crashed. I saw that there was a prior bug (AVRO-1667) that fixed some things in the Java parser.

      The same test-case on that bug will cause avrogencpp to segfault.

      $ cat tree.avro
      {
      "type":"record",
      "name":"SampleNode",
      "namespace":"org.spf4j.ssdump2.avro",
      "fields":[

      {"name":"count","type":"int","default":0}

      ,
      {"name":"subNodes","type":
      {"type":"array","items":{
      "type":"record","name":"SamplePair",
      "fields":[
      {"name":"method","type":
      {"type":"record","name":"Method",
      "fields":[
      {"name":"declaringClass","type":{"type":"string","avro.java.string":"String"}},
      {"name":"methodName","type":{"type":"string","avro.java.string":"String"}}
      ]}},

      {"name":"node","type":"SampleNode"}

      ]
      }}
      }
      ]
      }

      $ avrogencpp -i tree.avro -o avro.cpp
      [ segfault ]

      Attachments

        1. AVRO-1937.patch
          7 kB
          Thiruvalluvan M. G.

        Activity

          People

            Unassigned Unassigned
            jaredgrubb Jared Grubb
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: