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

Uwe Schindler edited comment on LUCENE-9500 at 9/2/20, 10:16 PM:
-----------------------------------------------------------------

Hi,

will report this one tomorrow morning after waking up. I found another 
workaround, which - unfortunately - does not work. The alternative is to use a 
ByteBuffer, where the code in native c code looks fine. But unfortunately it 
won't work with heap-based ByteBuffer: If the buffer has an array / is not 
direct, it calls the same method that ignores offset.

So I'd suggest to arraycopy the code to beginning of byte[] as workaround.

It may take years until this is fixed, especially not in Java 8, not Java 11!

[~jpountz]: The only workaround is: Copy the dictionary to a fresh byte array 
to offset 0 and use the methods without offset.


was (Author: thetaphi):
Hi,

will report this one tomorrow morning after waking up. I found another 
workaround, which - unfortunately - does not work. The alternative is to use a 
ByteBuffer, where the code in native c code looks fine. But unfortunately it 
won't work with heap-based ByteBuffer: If the buffer has an array / is not 
direct, it calls the same method that ignores heap.

So I'd suggest to arraycopy the code to beginning of byte[] as workaround.

It may take years until this is fixed, especially not in Java 8, not Java 11!

[~jpountz]: The only workaround is: Copy the dictionary to a fresh byte array 
to offset 0 and use the methods without offset.

> Did we hit a DEFLATE bug?
> -------------------------
>
>                 Key: LUCENE-9500
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9500
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Adrien Grand
>            Priority: Minor
>         Attachments: PresetDictTest.java, test_data.txt
>
>
> I've been digging 
> [https://ci-builds.apache.org/job/Lucene/job/Lucene-Solr-NightlyTests-master/23/]
>  all day and managed to isolate a simple reproduction that shows the problem. 
> I've been starring at it all day and can't find what we are doing wrong, 
> which makes me wonder whether we're calling DEFLATE the wrong way or whether 
> we hit a DEFLATE bug. I've looked at it so much that I may be missing the 
> most obvious stuff.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to