| Summary: | memcheck/tests/leak_cpp_interior fails with GCC 5.1+ | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Aleksandar Rikalo <aleksandar.rikalo> |
| Component: | memcheck | Assignee: | Julian Seward <jseward> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | ivosh, mips32r2 |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Turn off CXX11_ABI | ||
I cannot comment anything about std::string implementation. However for your second query have a look at bug: https://bugs.kde.org/show_bug.cgi?id=345307 Created attachment 102518 [details]
Turn off CXX11_ABI
This patch forces leak_cpp_interior to be compiled using old implementation of std::string.
(In reply to Ivo Raisr from comment #1) > I cannot comment anything about std::string implementation. > However for your second query have a look at bug: > https://bugs.kde.org/show_bug.cgi?id=345307 Thank You for quick response. I've suggested patch for the first problem. (In reply to Aleksandar Rikalo from comment #2) > Created attachment 102518 [details] > Turn off CXX11_ABI > > This patch forces leak_cpp_interior to be compiled using old implementation > of std::string. This patch looks fine by me. If no one objects, I will commit it later today. (In reply to Aleksandar Rikalo from comment #2) > Created attachment 102518 [details] > Turn off CXX11_ABI > > This patch forces leak_cpp_interior to be compiled using old implementation > of std::string. Patch submitted in r16217. We should leave the bug open, as the original issue (closely related to #345307) is still valid. Closing this as (partially) fixed. For the remaining part of the problem, check https://bugs.kde.org/show_bug.cgi?id=345307. |
Memcheck's leak_cpp_interior test has purpose to test heuristics for detecting some common cases, where the pointer is pointing in the middle of the block, but the chunk is not lost. One of such cases is old implementation of string that has format: [_Rep] * _M_length * [basic_string<char_type>] _M_capacity * _M_dataplus _M_refcount * _M_p ----------------> unnamed array of char_type New library ABI introduced in GCC 5.1 includes new implementation of std::string. In new implementation pointer is no longer displaced from the beginning of the chunk. This causes failing of leak_cpp_interior test. From GCC version 5.1.0, allocation of exceptions in libstdc++ is changed. Before GCC version 5.1.0 emergency buffer was statically allocated. In version 5.1.0 it is swapped with object of class poll with dynamically allocated arena. This change also causes failing of leak_cpp_interior test. Memcheck detects dynamically allocated block of 72,704 bytes for 64bit architectures or 18,688 bytes for 32bit architectures, that is not visible when using older versions of libstdc++.