avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tibor Benke (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1361) The values of a map are not correct
Date Thu, 29 Aug 2013 11:59:51 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13753541#comment-13753541
] 

Tibor Benke commented on AVRO-1361:
-----------------------------------

Thank you very much! It's good to know that it was my mistake and not a bug :) I understood
what you wrote and the fixed program works like a charm. But I still get segmentation fault
when these lines are in the code:

{noformat}
    avro_value_get_size(&simple_map, &map_size);
    for (i = 0; i < map_size; i++) {
        avro_value_get_by_index(&simple_map, i, &tmp, (const char**)&key);
        avro_value_get_string(&tmp, (const char**)value, &value_size);
    }
{noformat}

I still use the 1.7.4 version.

I didn't found lot of examples on the internet, so you could use this sample program in the
documentation :)
                
> The values of a map are not correct
> -----------------------------------
>
>                 Key: AVRO-1361
>                 URL: https://issues.apache.org/jira/browse/AVRO-1361
>             Project: Avro
>          Issue Type: Bug
>          Components: c
>    Affects Versions: 1.7.4
>         Environment: Ubuntu 12.10
>            Reporter: Tibor Benke
>         Attachments: main.c, main-fixed.c
>
>
> When I put values into a map, the values appear delayed with one cycle:
> // pseudo code
> map = Map()
> for (i = 0; i < 5; i++) {
>    map.put(i, i)
> }
> // then map contains the following elements: {"0": "1", "1": "2", "2": "3", "3": "4",
"4": ""} 
> I wrote a sample code, which demonstrates the bug. I hope I'm not wrong. I have also
problems with the reference counting: if I comment out the free() calls in the program, I
get glibc errors. Is it possible, that the Avro frees not just its own pointers in the *decref()
calls?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message