Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurent ByteBuffer access issues in java 11 #129

Open
gtalmantWork opened this issue Nov 18, 2022 · 1 comment
Open

Concurent ByteBuffer access issues in java 11 #129

gtalmantWork opened this issue Nov 18, 2022 · 1 comment

Comments

@gtalmantWork
Copy link

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

@pzygielo
Copy link
Contributor

There was ByteBufferWithInfo used here already.
It was deliberately removed 12c3490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants