This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/70794] vector.push_back() crashes with std::bad_alloc after 2^32 calls


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70794

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |INVALID

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
You're running out of memory. Growing beyond 4294967297 chars will double the
vector's size, which will allocate 8GiB in addition to the 4GiB already used by
the vector. Before it can copy the elements to the new storage and free the old
4GiB it runs out of memory.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]