avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Douglas Creager (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AVRO-766) C: Memory leak from reference count cycles
Date Mon, 14 Feb 2011 15:10:57 GMT

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

Douglas Creager updated AVRO-766:
---------------------------------

    Attachment: ref-cycle.c

Here's a minimal test case that shows the memory leak.

{noformat}
$ gcc -o ref-cycle ref-cycle.c -lavro
$ valgrind --leak-check=full ./ref-cycle
[SNIP]
==48091== 2,782 (48 direct, 2,734 indirect) bytes in 1 blocks are definitely lost in loss
record 19 of 19
==48091==    at 0x1000121DE: realloc (vg_replace_malloc.c:236)
==48091==    by 0x100030BC3: avro_schema_record (in /usr/local/Cellar/avro-c/HEAD/lib/libavro.1.5.0-SNAPSHOT.dylib)
==48091==    by 0x100031CCE: avro_schema_from_json_t (in /usr/local/Cellar/avro-c/HEAD/lib/libavro.1.5.0-SNAPSHOT.dylib)
==48091==    by 0x10003234D: avro_schema_from_json (in /usr/local/Cellar/avro-c/HEAD/lib/libavro.1.5.0-SNAPSHOT.dylib)
==48091==    by 0x100000E4D: main (in ./ref-cycle)
{noformat}

> C: Memory leak from reference count cycles
> ------------------------------------------
>
>                 Key: AVRO-766
>                 URL: https://issues.apache.org/jira/browse/AVRO-766
>             Project: Avro
>          Issue Type: Bug
>          Components: c
>    Affects Versions: 1.5.0
>            Reporter: Douglas Creager
>         Attachments: ref-cycle.c
>
>
> If you parse a recursive Avro schema, you end up with a cycle in the reference graph
for the avro_schema_t objects that are created.  The reference counting mechanism that we're
using can't detect this, and so you get a memory leak.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message