eclipse-ee4j / eclipse-ee4j/orb

Concurent ByteBuffer access issues in java 11

Open
#129 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
30
Forks
28
Avg merge
3h 43m
Merged PRs (30d)
9

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.