[
https://issues.apache.org/jira/browse/ARROW-6806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16945980#comment-16945980
]
Antoine Pitrou commented on ARROW-6806:
---------------------------------------
The crash is during array validation, because the array's underlying buffers
are null. Backtrace:
{code}
(gdb) bt
#0 0x00007fffcde924e4 in arrow::Buffer::size (this=0x0) at
/home/antoine/miniconda3/envs/pyarrow/include/arrow/buffer.h:190
#1 0x00007fffcc6e9a3f in
arrow::internal::ValidateVisitor::ValidateOffsets<arrow::BinaryArray const>
(this=0x7fffffffc610, array=...) at ../src/arrow/array.cc:1324
#2 0x00007fffcc6dffc8 in arrow::internal::ValidateVisitor::Visit
(this=0x7fffffffc610, array=...) at ../src/arrow/array.cc:1173
#3 0x00007fffcc6ec025 in
arrow::VisitArrayInline<arrow::internal::ValidateVisitor> (array=...,
visitor=0x7fffffffc610) at ../src/arrow/visitor_inline.h:110
#4 0x00007fffcc6dabd7 in arrow::Array::Validate (this=0x555555dc66c0) at
../src/arrow/array.cc:1391
#5 0x00007fffcc6ea0ec in
arrow::internal::ValidateVisitor::ValidateListArray<arrow::ListArray>
(this=0x7fffffffc820, array=...) at ../src/arrow/array.cc:1308
#6 0x00007fffcc6e00d5 in arrow::internal::ValidateVisitor::Visit
(this=0x7fffffffc820, array=...) at ../src/arrow/array.cc:1184
#7 0x00007fffcc6ec1f9 in
arrow::VisitArrayInline<arrow::internal::ValidateVisitor> (array=...,
visitor=0x7fffffffc820) at ../src/arrow/visitor_inline.h:110
#8 0x00007fffcc6dabd7 in arrow::Array::Validate (this=0x555555dc8a70) at
../src/arrow/array.cc:1391
#9 0x00007fffcc9ec4df in arrow::ChunkedArray::Validate (this=0x555555aeb860)
at ../src/arrow/table.cc:194
#10 0x00007fffcc9f0ca3 in arrow::SimpleTable::Validate (this=0x555555aeb8b0) at
../src/arrow/table.cc:367
[...]
{code}
{code}
(gdb) p array.data_->buffers
$7 = std::vector of length 3, capacity 3 = {std::shared_ptr<arrow::Buffer>
(empty) = {
get() = 0x0
}, std::shared_ptr<arrow::Buffer> (empty) = {
get() = 0x0
}, std::shared_ptr<arrow::Buffer> (empty) = {
get() = 0x0
}}
{code}
> Segfault deserializing ListArray containing null/empty list
> -----------------------------------------------------------
>
> Key: ARROW-6806
> URL: https://issues.apache.org/jira/browse/ARROW-6806
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Affects Versions: 0.15.0
> Reporter: Max Bolingbroke
> Priority: Major
>
> The following code segfaults for me (Windows and Linux, pyarrow 0.13 and
> 0.15):
>
> {code:java}
> import pyarrow as pa
> from io import BytesIO
> x =
> b'\xdc\x00\x00\x00\x10\x00\x00\x00\x0c\x00\x0e\x00\x06\x00\r\x00\x08\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x03\x00\x10\x00\x00\x00\x00\x01\n\x00\x0c\x00\x00\x00\x08\x00\x04\x00\n\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x18\x00\x00\x00\x00\x00\x12\x00\x18\x00\x14\x00\x13\x00\x12\x00\x0c\x00\x00\x00\x08\x00\x04\x00\x12\x00\x00\x00\x14\x00\x00\x00\x14\x00\x00\x00`\x00\x00\x00\x00\x00\x0c\x01\\\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x18\x00\x00\x00\x00\x00\x12\x00\x18\x00\x14\x00\x00\x00\x13\x00\x0c\x00\x00\x00\x08\x00\x04\x00\x12\x00\x00\x00\x14\x00\x00\x00\x14\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x05\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xff\xff\xff\x06\x00\x00\x00$data$\x00\x00\x04\x00\x04\x00\x04\x00\x00\x00\x10\x00\x00\x00exchangeCodeList\x00\x00\x00\x00\xcc\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x16\x00\x0e\x00\x15\x00\x10\x00\x04\x00\x0c\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x10\x00\x00\x00\x00\x03\n\x00\x18\x00\x0c\x00\x08\x00\x04\x00\n\x00\x00\x00\x14\x00\x00\x00h\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
> r = pa.RecordBatchStreamReader(BytesIO(x))
> r.read_all()
> {code}
> I *think* what should happen instead is that I should get a Table with a
> single column named "exchangeCodeList", where the column is a ChunkedArray
> with a single chunk, where that chunk is a ListArray containing just a single
> element (a null). Failing that (i.e. if the bytestring is actually
> malformed), pyarrow should maybe throw an error instead of segfaulting?
> I'm not 100% sure how the bytestring was generated: I think it comes from a
> Java-based server. I can deserialize the server response fine if all the
> records have at least one element in the "exchangeCodeList" column, but not
> if at least one of them is null. I've tried to reproduce the failure by
> generating the bytestring with pyarrow but can't trigger the segfault.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)