You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Dustin Spicuzza (JIRA)" <ji...@apache.org> on 2015/08/27 04:59:45 UTC
[jira] [Commented] (AVRO-1561) [PATCH] segfault NPE in
avro_resolved_map_reader_get_by_index
[ https://issues.apache.org/jira/browse/AVRO-1561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14715987#comment-14715987 ]
Dustin Spicuzza commented on AVRO-1561:
---------------------------------------
I've seen chatter about a 1.8 release... seems like this would be good to fix.
> [PATCH] segfault NPE in avro_resolved_map_reader_get_by_index
> -------------------------------------------------------------
>
> Key: AVRO-1561
> URL: https://issues.apache.org/jira/browse/AVRO-1561
> Project: Avro
> Issue Type: Bug
> Components: c
> Affects Versions: 1.7.7
> Reporter: Dustin Spicuzza
> Priority: Critical
> Attachments: map_npe.patch
>
>
> This one took a long time to diagnose, but this bug only appears to happen when you have a map with an embedded record, provided that the record was previously there. Here's an example avsc that triggers the bug:
> {noformat}
> {
> "type" : "record",
> "name" : "ObjectWithMap",
> "namespace" : "foobar",
> "fields" : [ {
> "name" : "nested",
> "type" : {
> "type" : "record",
> "name" : "Nested",
> "fields" : [ {
> "name" : "something",
> "type" : "int"
> } ]
> }
> }, {
> "name" : "mapOfObjects",
> "type" : {
> "type" : "map",
> "values" : "Nested"
> }
> } ]
> }
> {noformat}
> The reason the bug occurs in this specific instance is because the schema causes the two Nested objects to be link records, and so a link resolver is set in the iface for the value, but it's never initialized.
> The patch copies the initialization code present in avro_resolved_array_reader_get_by_index into avro_resolved_map_reader_get_by_index and avro_resolved_map_reader_get_by_name, and the segfault no longer occurs.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)