Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.0.0
Description
In some tests in the Arrow test suite there are cases where arrays are made without allocating real buffers of data, using Buffer of length 0 and with nullptr as their data.
In this cases the Array::ToString() does lead to segfault, at least for Int arrays.
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x0000000101dac696 libarrow.500.dylib`std::__1::enable_if<is_integer_type<arrow::NumericArray<arrow::Int32Type>::TypeClass>::value, arrow::Status>::type arrow::ArrayPrinter::WriteDataValues<arrow::NumericArray<arrow::Int32Type> >(this=0x00007ffeefbfea98, i=0)::'lambda'(long long)::operator()(long long) const at pretty_print.cc:152:73 149 enable_if_integer<typename T::TypeClass, Status> WriteDataValues(const T& array) { 150 const auto data = array.raw_values(); 151 // Need to upcast integers to avoid selecting operator<<(char) -> 152 WriteValues(array, [&](int64_t i) { (*sink_) << internal::UpcastInt(data[i]); }); 153 return Status::OK(); 154 } 155
The issue can probably be worked around by checking if the data in the array is valid (at least for the most obvious cases, like NULLS or 0-length data) when building the string representation
Attachments
Issue Links
- links to