[Java][JDBC] ClobConsumer writes past VarCharVector data buffer for large CLOBs
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Localiza ClobConsumer y compara su protección frente al crecimiento del búfer de datos de VarCharVector con la comprobación equivalente de BinaryConsumer. Reproduce el problema con un CLOB cuyos datos UTF-8 superen la asignación inicial y, después, verifica que los datos acumulados de CLOB o del lote no corrompan el búfer de offsets y puedan leerse correctamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
ClobConsumer copies CLOB data into the VarCharVector data buffer with MemoryUtil.copyToMemory at offset startIndex + totalBytes, but the buffer-growth guard checks dataBuffer.writerIndex() + bytes.length > dataBuffer.capacity(). copyToMemory never advances writerIndex(), and nothing else does either, so it stays at 0 and the guard only ever checks that a single chunk fits at offset 0. Once the cumulative bytes of a CLOB (or a batch of CLOB rows) exceed the initial data-buffer allocation of about 32 KB, reallocDataBuffer() is never called and copyToMemory, which performs no ArrowBuf bounds checking, writes past the allocation into adjacent off-heap memory.
The sibling BinaryConsumer uses the correct check: while (vector.getDataBuffer().capacity() < (startOffset + dataLength + read)).
To reproduce, consume a single CLOB whose UTF-8 length exceeds the initial data buffer (for example INITIAL_VALUE_ALLOCATION * 8 * 4 characters). The out-of-bounds write corrupts the adjacent offset buffer, and reading the value back throws NegativeArraySizeException.
- Lenguaje dominante
- Java
- Estrellas
- 95
- Forks
- 154
- Merge medio
- 2 d 16 h
- PR fusionados (30 d)
- 9
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/arrow-java
-
Type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/arrow-java#1300 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
apache/arrow-java#1261 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/arrow-java#1236 ·
-
Type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
apache/arrow-java#1205 ·
-
Type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/arrow-java#1196 · 1 comentario ·
Todos los issues de apache/arrow-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
infinispan/infinispan#18150 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
opensearch-project/k-NN#3597 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100