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

Tim Allison edited comment on TIKA-3092 at 4/14/20, 6:51 PM:
-------------------------------------------------------------

Ok.  This one is spooky...props to anyone who can figure out what's going on.  
I have a fix, but no explanation as to why this fix works.

The symptom was that we were getting different text when running multithreaded 
than when running in a single thread.

In the HwpStreamReader, we use Java's InflaterInputStream with an Inflater to 
wrap compressed inputstreams -- as a side note, I confirmed there is no diff 
btwn Java and commons-compress.

We were calling POI IOUtil's ensureSkip which uses a static byte array buffer 
to read off the right number of bytes.  We had the same problem with our 
IOUtil's static skip method.

When I switched to use an instance byte array buffer for reading/skipping 
rather than the static buffer, the problem went away.

This seems to work in both Java 8 and Java 13.  I can't explain the fix, and I 
can't explain why we haven't seen this problem before.




was (Author: [email protected]):
Ok.  This one is spooky...props to anyone who can figure out what's going on.  
I have a fix, but no explanation as to why this fix works.

The symptom was that we were getting different text when running multithreaded 
than when running in a single thread.

In the HwpStreamReader, we use Java's InflaterInputStream with an Inflater to 
wrap compressed inputstreams -- as a side note, I confirmed there is no diff 
btwn Java and commons-compress.

We were calling POI IOUtil's ensureSkip which uses a static byte array buffer 
to read off the right number of bytes.  When I switched that to use an instance 
byte array buffer for reading/skipping, the problem went away.

This seems to work in both Java 8 and Java 13.  I can't explain the fix, and I 
can't explain why we haven't seen this problem before.



> Apparent multithreading bug in HWP5 parser
> ------------------------------------------
>
>                 Key: TIKA-3092
>                 URL: https://issues.apache.org/jira/browse/TIKA-3092
>             Project: Tika
>          Issue Type: Task
>            Reporter: Tim Allison
>            Assignee: Tim Allison
>            Priority: Major
>
> We got some weird behavior in the most recent regression tests for 1.24.1 on 
> HWP5 files.  When I ran MultiThreadedTikaTest on .hwp files, I was able to 
> confirm we get different output when running multithreaded.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to