Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.2
-
None
-
None
Description
When same MemoryBuffer is accessed by multiple thread concurrently then it can lead to BufferUnderflowException.
MemoryManagerService.retrieve method performs following steps
1. Get MemoryBuffer associated with the Pointer
2. Set its readerIndex to 0
3. Call readBytes. Which for NioMemoryBuffer invokes following code
@Override
public int readBytes( byte[] bytes, int offset, int length )
So if multiple thread invoke retrieve with same Pointer then readerIndex might be set to wrong value leading to BufferUnderflowException
Refer to [1] for details