https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
I ran into problems with / valgrind crash using std :: string in GCC 5. The link above indicates that GCC 5.x is running in ABI. The new default ABI for libstd ++ is C ++ 11/14 ... which is incompatible with the old ABI. There is a way to select a senior ABI using the definition.
I am trying to understand what is the difference between ABI and did not find details. I would like to help understand:
- What problems with std :: string need to be fixed in order to be compatible with the new ABI? Are they associated with the copy to record?
- Will these changes change it for an older ABI?
- Any tips for working _GLIBCXX_USE_CXX11_ABI?
More on the issue I encountered ( https://github.com/YasserAsmi/jvar/issues/21 ) The project worked great in GCC 4.8 and Clang. With GCC, the same code refuses to run:
x_misc(33112,0x7fff728c2000) malloc: *** error for object 0x7fd639c034cc: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap: 6
And here is the partial output of Valgrind:
==33027== Invalid read of size 1 ==33027== at 0x1006F78BA: _platform_memmove$VARIANT$Nehalem (in /usr/lib/system/libsystem_platform.dylib) ==33027== by 0x100009388: jvar::Variant::toString[abi:cxx11]() const (in bin/ex_misc) ==33027== by 0x1000023A7: bugreport() (in bin/ex_misc) ==33027== by 0x1000133B8: main (in bin/ex_misc)
The project uses std :: string and has some custom memory management. It performs some non-standard but valid operations using new placement constructors, etc. I try to better understand what code the API runs and how to fix it - a place to run.
source share