You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "reckart (via GitHub)" <gi...@apache.org> on 2023/02/07 14:50:27 UTC

[GitHub] [uima-uimaj] reckart opened a new issue, #304: Unable to deserialize CAS if last element on the heap is an empty array

reckart opened a new issue, #304:
URL: https://github.com/apache/uima-uimaj/issues/304

   **Describe the bug**
   There is a very rare bug in deserializing a CAS when the last element on the heap is an empty array and the heap and there is no additional space on the heap after that element.
   
   **To Reproduce**
   TBH, I have no idea how to really reproduce this. But here is what happens:
   
   **BinaryCasSerDes.java**
   ```
        heapIndex=254
        heap.heap.length=256
   ----
         if (type.isArray()) {
           final int len = heap.heap[heapIndex + arrayLengthFeatOffset]; // We get the length of the array -> 0
           final int bhi = heap.heap[heapIndex + arrayContentOffset]; // We get the pointer(?) to the start of the array 254+2 -> CRASH
   ```
   
   The code crashes with an `IndexOutOfBoundsException` because `heapIndex + arrayContentOffset >= heap.heap.length`. However, we do not really need `bhi` because the array is empty and thus we won't read its contents anyway.
   
   **Expected behavior**
   If the array is empty, skip `bhi` and related core entirely.
   
   **Please complete the following information:**
    - Version: 3.4.0
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@uima.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [uima-uimaj] reckart closed issue #304: Unable to deserialize CAS if last element on the heap is an empty array

Posted by "reckart (via GitHub)" <gi...@apache.org>.
reckart closed issue #304: Unable to deserialize CAS if last element on the heap is an empty array
URL: https://github.com/apache/uima-uimaj/issues/304


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@uima.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org