Problem:
Race condition in cpp/src/arrow/array/array_dict.cc line 112. The dictionary() method does lazy initialization without locks - multiple threads can simultaneously see dictionary_ as null and both try to initialize, causing memory corruption or double-free.
Location:
cpp/src/arrow/array/array_dict.cc lines 110-116
const std::shared_ptr<Array>& DictionaryArray::dictionary() const {
if (!dictionary_) {
// TODO(GH-36503) this isn't thread safe
dictionary_ = MakeArray(data_->dictionary);
}
return dictionary_;
}
### Component(s)
C++
Problem:
Race condition in cpp/src/arrow/array/array_dict.cc line 112. The
dictionary()method does lazy initialization without locks - multiple threads can simultaneously seedictionary_as null and both try to initialize, causing memory corruption or double-free.Location:
cpp/src/arrow/array/array_dict.cc lines 110-116