Skip to content

Concurent ByteBuffer access issues in java 11 #129

@gtalmantWork

Description

@gtalmantWork

We found an issue when trying to access a single corba object in java 11 in a multithreaded process.
In the class CDRInputStream_1_0, we found only one bytebuffer instance for all the threads.
Because of that, the saved position changes for all the threads causing the buffer to reach its limit before even being read.
And because the buffer reaches its limits, we have two issues:
1°/ The position we want to read is wrong
2°/ The grow method is called so it raises an unexpectedEof in the BufferManagerReadGrow.underflow method
We analysed the differences with java 8 which was OK.
In the java 8 code, the ByteBuffer is wrapped into a ByteBufferWithInfo in the CDRInputStream_1_0 make which makes it thrad-safe.
All the instances of the ByteBufferWithInfo are different to prevent the indexes to change in every thread at the same time.
Do you think it would be possible to patch this issue by adding back the ByteBufferWithInfo instance in the CDRInputStream_1_0 class ?
Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions