http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60750
Bug ID: 60750
Summary: double free after std::move on string inside throw
when compiled with optimization
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: sshannin at gmail dot com
Host: Linux hostname 3.2.0-29-generic #46-Ubuntu SMP Fri Jul
27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Target: x86_64-unknown-linux-gnu
Build: ../gcc-4.8.2/configure --disable-multilib
--enable-languages=c++ --program-suffix=-4.8.2
Created attachment 32535
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32535&action=edit
Source
If I compile the attached source without optimization and run it (g++-4.8.2
--std=c++11 -o sample sample.cpp; ./sample), it behaves as expected.
If I compile with even O1 (g++-4.8.2 --std=c++11 -O1 -o sample sample.cpp), I
get the glibc double free warning dump.
I considered this source small enough (with standard headers) to not require
the preprocessed to be attached. Let me know if that, or any other info, is
desired as well