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

Douglas Creager commented on AVRO-741:
--------------------------------------

This happens on 64-bit Ubuntu, too.

I've tracked down the "why", but haven't had a chance to put together a patch 
yet.  The problem is that before, the binary encoding class ensured that it 
allocated an extra byte for bytes values, and made sure they were NUL 
terminated.  It doesn't do that anymore.  Inside of file_read_header, the JSON 
schema for the file is stored in a bytes value, which we pass right in to 
avro_schema_from_json — which expects the JSON string to be NUL-terminated.  So 
if the byte right after the schema string isn't a \x00, then we get a segfault.

> C: examples/quickstep segfaults
> -------------------------------
>
>                 Key: AVRO-741
>                 URL: https://issues.apache.org/jira/browse/AVRO-741
>             Project: Avro
>          Issue Type: Bug
>          Components: c
>            Reporter: Doug Cutting
>            Priority: Blocker
>             Fix For: 1.5.0
>
>
> On ubuntu 10.10 32-bit, 'cd lang/c; configure ; make check' currently fails.  
> The failure is when running examples/quickstep:
> {code}
> make[2]: Entering directory `/home/cutting/src/avro/trunk/lang/c/examples'
> Successfully added Hicks, Dante id=1
> Successfully added Graves, Randal id=2
> Successfully added Loughran, Veronica id=3
> Successfully added Bree, Caitlin id=4
> Successfully added Silent, Bob id=5
> Successfully added ???, Jay id=6
> Now let's read all the records back out
> Error printing person
> FAIL: quickstop
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to