iverase commented on pull request #541:
URL: https://github.com/apache/lucene/pull/541#issuecomment-1019443628


   I tried to reproduce the issue in another machine again and I was able to 
do. In addition I was able to run it as well successfully, the difference 
between the two runs is that in the successful one I got this warning message:
   
   ```
   WARNING: Unmapping is not supported, because Lucene cannot read 
'jdk.unsupported' module [please add 'jdk.unsupported' to modular application 
either by command line or its module descriptor]
   ```
   
   So you need to make sure you can run MMAP which points to the readInts 
implementation in `ByteBufferIndexInput`. Just a quick check by removing the 
implementation shows that the error disappears for MMAP.
   
   
   I had a look into the method and I could not spot anything doggy. More over, 
I replaced the line:
   
   ```
   guard.getInts(curIntBufferViews[position & 0x03].position(position >>> 2), 
dst, offset, length);
   ```
   
   with: (Not reusing the int buffers)
   
   ```
   IntBuffer intBuffer = 
curBuf.duplicate().order(ByteOrder.LITTLE_ENDIAN).position(position).asIntBuffer();
   guard.getInts(intBuffer, dst, offset, length);
   ```
   
   And the error disappear. Not sure what is going on, maybe a jdk bug?


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to