[Bug lto/82172] Destruction of basic_string in basic_stringbuf::overflow with _GLIBCXX_USE_CXX11_ABI=0, -flto, and C++17 mode results in invalid delete
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 21 10:05:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82172
--- Comment #28 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks, Dave. That's very helpful.
(In reply to Gubbins from comment #26)
> > The fix here is that __ZNSs4_Rep20_S_empty_rep_storageE needs to be weak when libstdc++.6.dylib is built.
Or make sure the explicit instantiation is declared in <string> so that the
symbol is not emitted in the program, and the one in libstdc++.6.dylib is
always used. Which is how this bug was fixed.
I need to investigate whether we have a problem with any other explicit
instantiations which are not declared in headers, e.g. these ones
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/src/c%2B%2B11/ext11-inst.cc;h=5d16ea6ea185be25be48e030de74e3448eddf2e6;hb=HEAD
More information about the Gcc-bugs
mailing list