AliRana30 opened a new issue, #49064:
URL: https://github.com/apache/arrow/issues/49064
### Describe the bug, including details regarding any error messages,
version, and platform.
**Problem:**
Race condition in
[cpp/src/arrow/array/array_dict.cc](cci:7://file:///C:/Users/PMLS/Desktop/apache/arrow/cpp/src/arrow/array/array_dict.cc:0:0-0:0)
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](cci:7://file:///C:/Users/PMLS/Desktop/apache/arrow/cpp/src/arrow/array/array_dict.cc:0:0-0:0)
lines 110-116
```cpp
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++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]