Hello,I met some very strange behavior when using SBE java generated stubs. The application is driven by a fork-join thread pool, and I have a ThreadLocal ByteBuffer for the SBE encoder and decoder. It happens but very rarely that the header encoded is inconsistent while the data encoded is correct. To debug this I have logged all the encoded bytes to a file stream, and found the incorrectly encoded header are sometimes all 0 and sometimes appears to be for another SBE message. It looks as if the header are not written at all so what was left in the buffer last time was there. However, the data part seems good though. Btw I always clear the ByteBuffer before each use.
--This problem happens when I use allocateDirect() for the ByteBuffer (as the ThreadLocal initialValue), and seems to disappear if I just use allocate(). Is the allocateDirect() not thread safe so that it actually allocates duplicate off-heap memories for my local buffers? Or is there any other situations which can make the Agrona UnsafeBuffer's putXXX method ineffective?Thanks a lot.
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Sent from my phone
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If you read that bug report, it sometimes results in a sigsegv and sometimes corruption whereby a 0 is read out rather than the stored value. The sigsegv is likely due to broken address calculation resulting in access to an invalid page, whereas a 0 is a bogus access to a valid page. Which one you hit depends on allocation pattern.
One of the linked bug reports is broken for an int, whereas the one I pasted is for longs. I don't know if shorts are affected the same way or not, but I see no reason why not.
Having said that, I don't know if it's related to your issue. But turning off tiered compilation and/or trying Xint to see if it reproduces is a worthwhile experiment.
On Tue, Nov 15, 2016 at 5:05 PM Martin Thompson <mjp...@gmail.com> wrote:
Not sure if it is related. The case we are seeing is with Unsafe.putShort and it does not result in a SIGEV.
On Tuesday, 15 November 2016 19:14:23 UTC, Vitaly Davidovich wrote:
Could be this: https://bugs.openjdk.java.net/browse/JDK-8087134.
Are the failures happening when C1 is enabled (i.e. Tiered comp is enabled)?
On Tue, Nov 15, 2016 at 1:44 PM Martin Thompson <mjp...@gmail.com> wrote:
We have had another similar issue raised on this in a single threaded example. It seems that writes to a direct buffer sometimes when read later are zero, as if they never happened. I'm going to look into creating an example of this that is not SBE or Agrona specific because it looks like a direct ByteBuffer issue.--Anyone else seen similar?
On Saturday, 24 September 2016 03:10:38 UTC+1, Wayne wrote:Hello,I met some very strange behavior when using SBE java generated stubs. The application is driven by a fork-join thread pool, and I have a ThreadLocal ByteBuffer for the SBE encoder and decoder. It happens but very rarely that the header encoded is inconsistent while the data encoded is correct. To debug this I have logged all the encoded bytes to a file stream, and found the incorrectly encoded header are sometimes all 0 and sometimes appears to be for another SBE message. It looks as if the header are not written at all so what was left in the buffer last time was there. However, the data part seems good though. Btw I always clear the ByteBuffer before each use.This problem happens when I use allocateDirect() for the ByteBuffer (as the ThreadLocal initialValue), and seems to disappear if I just use allocate(). Is the allocateDirect() not thread safe so that it actually allocates duplicate off-heap memories for my local buffers? Or could there be any low level memory model stuff which can make the Agrona UnsafeBuffer's putXXX method ineffective?Thanks a lot.
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Sent from my phone
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.