[jira] [Created] (IGNITE-6636) BinaryStream position integer overflow

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IGNITE-6636) BinaryStream position integer overflow

Anton Vinogradov (Jira)
Alexandr Kuramshin created IGNITE-6636:
------------------------------------------

             Summary: BinaryStream position integer overflow
                 Key: IGNITE-6636
                 URL: https://issues.apache.org/jira/browse/IGNITE-6636
             Project: Ignite
          Issue Type: Bug
      Security Level: Public (Viewable by anyone)
          Components: general
    Affects Versions: 2.2
            Reporter: Alexandr Kuramshin


There were some issues with negative {{BinaryAbstractStream#pos}} value.

We may get stack trace like that
{noformat}
java.lang.ArrayIndexOutOfBoundsException: -2142240123
        at org.apache.ignite.internal.binary.streams.BinaryHeapOutputStream.writeByteAndShift(BinaryHeapOutputStream.java)
        at org.apache.ignite.internal.binary.streams.BinaryAbstractOutputStream.writeByte(BinaryAbstractOutputStream.java)
        at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java)
        at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java)
{noformat}

The worst of it is that the {{ArrayIndexOutOfBoundsException}} has been thrown on the next write to the stream, and upon stack unwinding we couldn't know which object actually cause the overflow.

I've to suggest to check all updates to the {{BinaryAbstractStream#pos}} and throw exception right after the change.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)