This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/70794] vector.push_back() crashes with std::bad_alloc after 2^32 calls
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Jul 2016 10:24:03 +0000
- Subject: [Bug libstdc++/70794] vector.push_back() crashes with std::bad_alloc after 2^32 calls
- Auto-submitted: auto-generated
- References: <bug-70794-4@http.gcc.gnu.org/bugzilla/>
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.