Check the logical slice boundary before subtracting a Doris read offset
Check the logical slice boundary before relying on the enclosing packed object's size. Separate direct-reader and cache-protected paths when investigating an out-of-range offset.
Physical objects and logical slices
Validate an offset against the logical slice before calculating remaining length. Otherwise an apparently successful read can return neighboring file bytes. Truthound Core can check a prepared offset table against independently recorded slice boundaries. [1, 2, 3]
Unsigned subtraction and cache scope
Doris issue #69863 reports unsigned subtraction wrapping when offset exceeds a packed slice in 4.1.4 cloud mode. Follow-up source review limits exposure: a cache wrapper can reject the invalid starting offset first. It does not establish that a production query returned incorrect data. [1]
Record the actual reader chain
Record slice identity, size, logical offset, requested length, and actual reader chain. Enforce offset<=slice_size before reading; check negative sizes and physical object boundaries separately. The packed object’s valid range cannot stand in for the slice’s range. [1, 3]
EOF and one byte beyond
Declare a slice of 100 bytes. Offset 100 passes the EOF boundary but must return 0 bytes. Offset 101 fails and should be rejected before reading a neighboring slice. This fixture tests the starting boundary, not every condition on request length. [1, 3]
Comparison does not wrap the reader
ColumnPairValidator in Truthound Core Python SDK 3.3.2 can compare prepared non-null offsets and sizes with <=. It does not wrap PackedFileReader or block memory access. The operator provides exact sizes and keeps cache-protected and direct-reader paths distinct. [1, 2, 3]
Use distinguishable neighbor bytes
Verify the reader’s explicit error path in an isolated test using distinguishable neighboring bytes. Include EOF and negative-size controls. Do not attribute an invalid upstream offset to corrupt metadata without separate evidence. [1, 3]
Successful reads still need ownership
A successful lower-level object read only proves the physical range exists. The logical-file contract still decides whose bytes may be returned, which is why both boundaries belong in the diagnostic record. [1, 3]
Application conditions
Prepare slice size, logical offset, request length, and the actual reader chain.
Alternatives
Test EOF, negative size, and distinguishable neighboring bytes in isolation.
Limitations
An earlier cache-wrapper guard prevents generalizing exposure to every packed query.
Evidence
- Event checked
- Subject checked
- Modified
