I'm getting a weird error, when initializing my deque or vector. I'm using QtCreator and a CMake-Project.
If I use a deque, it aborts on initialization:
std::deque<int> myValues; // <-- abort here
for (int i=0;i<10;++i)
{
myValues.push_back(i);
}
when I use deque, it aborts on push_back:
std::vector<int> myValues;
for (int i=0;i<10;++i)
{
myValues.push_back(i); // <-- abort here
}
I can't find out why this is happening now (it worked that way all the time). Both aborts happen inside _gnu_cxx::new_allocator< int >::allocate.
Any hints?
Thanks for the effort in advance!
Hartmut
It looks like a heap corruption in some other place in your program. That is, you write out-of-bounds or delete an invalid pointer somewhere. Once the heap internal structure is corrupted, substantial allocations may crash your program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With