Comments (5)
Preliminary troubleshooting:
The bug happens in this function:
https://github.com/boostorg/move/blob/6cb4f456d1cac72c674160c689913ac3e12e54d0/include/boost/move/algo/detail/adaptive_sort_merge.hpp#L2404
merge_bufferless
is called with the first range incorrectly sorted
from container.
This fixes the problem but may have side effects I am not aware of.
https://github.com/boostorg/container/blob/develop/include/boost/container/vector.hpp#L2183
size_type const n = static_cast<size_type>(boost::container::iterator_distance(first, last));
size_type const s = this->size();
if(BOOST_LIKELY(s)){
size_type const c = this->capacity();
size_type const free_c = (c - s);
//Use a new buffer if current one is too small for new elements,
//or there is no room for position indexes
if(free_c < n){
size_type const new_size = s + n;
size_type new_cap = new_size;
pointer p = pointer();
p = this->m_holder.allocation_command(allocate_new, new_size, new_cap, p);
this->priv_merge_in_new_buffer(UniqueBool(), first, n, comp, p, new_cap);
}
else{
T *raw_pos = boost::movelib::iterator_to_raw_pointer(this->insert(this->cend(), first, last));
T *raw_beg = this->priv_raw_begin();
T *raw_end = this->priv_raw_end();
std::inplace_merge(raw_beg, raw_pos, raw_end, comp);
// boost::movelib::adaptive_merge(raw_beg, raw_pos, raw_end, comp, raw_end, free_c - n);
if(UniqueBool::value){
size_type const count =
static_cast<size_type>(raw_end - boost::movelib::unique(raw_beg, raw_end, boost::movelib::negate<Compare>(comp)));
this->priv_destroy_last_n(count);
}
}
}
else{
this->insert(this->cend(), n, first, last);
}
from container.
Thanks for reporting, it was a bug in Boost.Move[1], updating Boost.Move should fix the issue. Let me know if the problem is gone.
[1] boostorg/move#15
from container.
Thank you for your timely fix.
from container.
Closing the issue as fixed. Thanks for the report.
from container.
Related Issues (20)
- Support for VM based allocators/container storage
- End iterators are not dereferencable
- Ability to choose static_vector's size_type
- dtl vs std pair HOT 1
- Compiler specific header bug HOT 1
- small_vector<T> is misaligned on the stack in 32 bits HOT 2
- -Wstringop-overread emitted on simple boost small_vector code with gcc 12.3 HOT 3
- flat_multimap::emplace not sorting elements under GCC HOT 1
- flat_multimap::emplace not sorting elements under GCC HOT 6
- Modular Boost C++ Libraries Request HOT 1
- Support 'pure' (single pass) input_iterators HOT 1
- [1.85] flat_map/vector crashes on appends (memory corruption) HOT 6
- New container: chunked_vector HOT 1
- Compilation fails if custom key comparison is used HOT 1
- boost-container build failure by using emscripten HOT 4
- Provide a way to specify `deque` block size per container HOT 2
- small_vector cannot go back to use stack space HOT 1
- Several containers don't support non-movable types when move assigning
- As of boost 1.85, any key is found in any non-empty flat_multimap HOT 2
- C++23, libstdc++-14, clang++-17 : trivial flat_map::operator[] program fails to compile HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from container.