ezbr opened a new issue, #53777:
URL: https://github.com/apache/arrow/issues/53777

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   The check at 
https://github.com/apache/arrow/blob/main/cpp/src/arrow/util/tdigest.cc#L172:
   ```cc
       // check if buffer expanded
       if (tdigests_[0].capacity() > delta_ || tdigests_[1].capacity() > 
delta_) {
         return Status::Invalid("oversized tdigest buffer");
       }
   ```
   seems meant to verify that inserting into the buffers up to the previously 
reserved capacity didn't cause a reallocation to a larger capacity. However, 
the check is assuming that std::vector::reserve uses an exact capacity 
reservation, which is not guaranteed 
(https://en.cppreference.com/cpp/container/vector/reserve). We should update or 
remove this check, which relies on implementation details of std::vector that 
are subject to change.
   
   Motivation: I'm working on using size-returning-new in std::vector::reserve, 
which causes this check to fail.
   
   (See sample fix in https://github.com/apache/arrow/pull/52276.)
   
   ### 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]

Reply via email to