uschindler commented on pull request #2052: URL: https://github.com/apache/lucene-solr/pull/2052#issuecomment-748580504
> On Windows, alignment is done differently from Linux, and thus the aligned slice size could be smaller than the intended buffer size. This may also hidden on other operating systems. It depends on if the buffer is already aligned when you call alignSlice(). If it is not aligned (seems to happen 100% of the time on windows), then the returned slice is ALWAYS smaller than original size. If you read the example code by OpenJDK developers and the tests: You need to overallocate (`finalSize + blockSize - 1`) and then get the aligned slice. This problem (the slice was smaller than expeceted) together with duplicate "state" fields (position and size were duplicated in the code, instead of using position inside buffer and limit/capacity) caused the out of bounds calls and exception. This is all fixed now. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org