Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.10.0
-
None
-
None
Description
The code that allocates a new RepeatedListVector does not initialize the first offset to zero as required:
@Override public void allocateNew(int valueCount, int innerValueCount) { clear(); getOffsetVector().allocateNew(valueCount + 1); getMutator().reset(); }
Since Netty does not zero-fill vectors, the result is vector corruption.
If the code worked correctly, here is the behavior when writing to the first element of the list:
- Access the offset vector at offset 0. Should be 0.
- Write the new value at that offset. Since the first offset is 0, the first value is written at 0 in the value vector.
- Write into offset 1 the value at offset 0 plus the length of the new value.
But, the offset vector is not initialized to zero. Instead, offset 0 contains the value 16 million. Now:
- Access the offset vector at offset 0. Value is 16 million.
- Write the new value at that offset. Write at position 16 million. This requires growing the value vector from its present size to 16 MB.
Attachments
Issue Links
- Is contained by
-
DRILL-5601 Rollup of External Sort memory management fixes
- Resolved