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

Mika Ristimaki commented on AVRO-1405:
--------------------------------------

Yeah you are right. If I understood correctly, if fread reads exactly to the 
end of file (but doesn't try to read past it) feof() will return false. 

In this use case the bug will be triggered if Avro data file is exactly a 
multiple of a block size in which that file is read. Most likely LZ4 does some 
padding to make the file size always be a multiple of some value. Unfortunately 
at least I don't have time to look into this issue now, and also IMO a new Jira 
issue should be created for this bug and continue the discussion there.

> Avro-c may not handle eof correctly if avro data file contains multiple sync 
> markers
> ------------------------------------------------------------------------------------
>
>                 Key: AVRO-1405
>                 URL: https://issues.apache.org/jira/browse/AVRO-1405
>             Project: Avro
>          Issue Type: Bug
>          Components: c
>    Affects Versions: 1.7.5
>            Reporter: Mika Ristimaki
>            Assignee: Mika Ristimaki
>            Priority: Minor
>             Fix For: 1.7.6
>
>         Attachments: AVRO-1405.patch, AVRO-1405.patch
>
>
> I encountered a bug in the Avro C API. If the following is done, it seems 
> that the Avro data file reader can not read the file correctly
> {code}
> while (has values to write) {
>       Open file for writing
>       Write a value to the file
>       Close the writer
> }
> {code}
> Reading this file with Avro data file reader fails with EOF after only the 
> first item has been read from the file.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to