[Bug c++/68073] New: free(): invalid pointer errors with short strings using _GLIBCXX_USE_CXX11_ABI=1

2015-10-23 Thread nikola.kovacs at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nikola.kovacs at gmail dot com Target Milestone: --- Created attachment 36569 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36569&action=edit testcases D

[Bug c++/68073] free(): invalid pointer errors with short strings using _GLIBCXX_USE_CXX11_ABI=1

2015-10-24 Thread nikola.kovacs at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 --- Comment #2 from nikola.kovacs at gmail dot com --- It's not my code, I'm just trying to make it work. The problem is it creates a new string into data, which is std::aligned_storage: new (&data) target_type(std::forward(

[Bug c++/68073] free(): invalid pointer errors with short strings using _GLIBCXX_USE_CXX11_ABI=1

2015-10-24 Thread nikola.kovacs at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 --- Comment #3 from nikola.kovacs at gmail dot com --- Never mind, I misread the documentation. It looks like something else is causing the problem, since this works fine, and it calls the destructor directly: (modified example from http

[Bug c++/68073] free(): invalid pointer errors with short strings using _GLIBCXX_USE_CXX11_ABI=1

2015-10-24 Thread nikola.kovacs at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 --- Comment #4 from nikola.kovacs at gmail dot com --- (sorry for the triple post) I figured it out, it was caused by swap operating on std::aligned_storage, so it didn't properly swap the string.