This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Add AddressSanitizer annotations to std::string
- From: Kashkarov Mikhail <m dot kashkarov at partner dot samsung dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++\@gcc.gnu.org" <libstdc++ at gcc dot gnu dot org>, Vyacheslav Barinov <v dot barinov at samsung dot com>, Ivan Baravy <i dot baravy at samsung dot com>
- Date: Tue, 29 May 2018 16:47:01 +0300
- Subject: Re: Add AddressSanitizer annotations to std::string
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180529134706euoutp023b484a1a620d6d14ae602cfdfd5d7c16~zIZXyYVp82238122381euoutp02V
- References: <CGME20180529065149eucas1p1eaa57ecb726d2d535955d12cfc103bef@eucas1p1.samsung.com> <20180529065149eucas1p1eaa57ecb726d2d535955d12cfc103bef~zCuxkl0Na0943909439eucas1p18@eucas1p1.samsung.com> <20180529124736.GI7974@redhat.com>
Jonathan Wakely <jwakely@redhat.com> writes:
> On 29/05/18 09:51 +0300, Mikhail Kashkarov wrote:
>>Hello,
>>
>>I'd like to propose following features for the review:
>>
>>[1] Add option to disable std::string small-string optimization usage.
>>Add _GLIBCXX_DISABLE_SSO_USAGE define that disables c++11 std::string
>>_M_local_buf usage to let AddressSanitizer poison string buffer correctly.
>>
>>[2] Add AddressSanitizer annotations to std::string.
>>String annotations can be enabled with _GLIBCXX_ANNOTATE_STRING define.
>>For COW-strings annotation we need to align the beginning of string
>>buffer by 8
>>(ASan requirements), so the layout change is applied if annotations in on.
>>This work is based on Ivan Baravy draft patches for string annotations.
>
> Thanks for the patches, I'll comment on the two emails individually.
>
>>Also, while testing annotations for older compiler versions I managed to
>>find
>>libstdc++ bugs in std::regex/std::basic_stringbuf that are fixed in
>>upstream now so it could be useful not only for testing projects but for the
>>library itself.
>
> That's good to know.
>
> Were there bugzilla reports for these bugs you found? I'd like to be
> sure they were fixed intentionally and that we have tests to ensure
> the bugs don't get re-introduced later.
PR/81338 for std::basic_stringbuf (unused capacity from string).
For std::regex i did't look for the reports, but there were failing tests
28_regex/algorithms/regex_match/ecma/char/57173.cc
28_regex/algorithms/regex_match/ecma/char/53622.cc
for strings without sso usage that got resolved somewhere between
f1717362 and current head.