You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org> on 2017/02/14 11:50:41 UTC

[jira] [Updated] (AVRO-1937) C++ generator for recursive structure crashes

     [ https://issues.apache.org/jira/browse/AVRO-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thiruvalluvan M. G. updated AVRO-1937:
--------------------------------------
    Status: Patch Available  (was: Open)

Here is a patch that fixes the problem. It handles recursive structures through arrays, maps and unions well.

> C++ generator for recursive structure crashes
> ---------------------------------------------
>
>                 Key: AVRO-1937
>                 URL: https://issues.apache.org/jira/browse/AVRO-1937
>             Project: Avro
>          Issue Type: Bug
>          Components: c++
>    Affects Versions: 1.8.1
>            Reporter: Jared Grubb
>
> 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 ]



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)