public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "unlvsur at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/103453] ASAN detection with clang
Date: Wed, 01 Dec 2021 01:02:57 +0000	[thread overview]
Message-ID: <bug-103453-4-SavJ5U6ezX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103453-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103453

--- Comment #5 from cqwrteur <unlvsur at live dot com> ---
(In reply to Jonathan Wakely from comment #3)
> Fixed on trunk so far, but this is backportable.

#include<vector>

int main()
{
        std::vector<std::size_t> vec;
        vec.reserve(20);
        vec[3]=40;
}

clang++ -o vec vec.cc -Ofast -std=c++2b -fuse-ld=lld
-fsanitize=address,undefined

Nothing.

clang++ -o vec vec.cc -Ofast -std=c++2b -I../../include -fuse-ld=lld
-fsanitize=address,undefined -D_GLIBCXX_SANITIZE_STD_ALLOCATOR
-D_GLIBCXX_SANITIZE_VECTOR

=================================================================
==15804==ERROR: AddressSanitizer: container-overflow on address 0x01e922536bd8
at pc 0x7ff6596d16df bp 0x0001000ff700 sp 0x0001000ff748
WRITE of size 8 at 0x01e922536bd8 thread T0
    #0 0x7ff6596d16de in main
(D:\hg\fast_io\examples\0007.legacy\vec.exe+0x1400016de)
    #1 0x7ff6596d13b0 in __tmainCRTStartup
/home/cqwrteur/myhome/gcc_build/canadian/x86_64-w64-mingw32/mingw-w64/mingw-w64-crt/../../../../../mingw-w64/mingw-w64-crt/crt/crtexe.c:321:15
    #2 0x7ff6596d14e5 in mainCRTStartup
/home/cqwrteur/myhome/gcc_build/canadian/x86_64-w64-mingw32/mingw-w64/mingw-w64-crt/../../../../../mingw-w64/mingw-w64-crt/crt/crtexe.c:202:9
    #3 0x7ffc57577033  (C:\WINDOWS\System32\KERNEL32.DLL+0x180017033)
    #4 0x7ffc58fe2650  (C:\WINDOWS\SYSTEM32\ntdll.dll+0x180052650)

  parent reply	other threads:[~2021-12-01  1:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27 19:03 [Bug libstdc++/103453] New: " glisse at gcc dot gnu.org
2021-11-27 23:33 ` [Bug libstdc++/103453] " redi at gcc dot gnu.org
2021-11-30  0:21 ` pinskia at gcc dot gnu.org
2021-11-30 13:52 ` redi at gcc dot gnu.org
2021-11-30 20:11 ` cvs-commit at gcc dot gnu.org
2021-11-30 20:18 ` redi at gcc dot gnu.org
2021-12-01  1:01 ` unlvsur at live dot com
2021-12-01  1:02 ` unlvsur at live dot com [this message]
2021-12-01  1:06 ` unlvsur at live dot com
2021-12-01  1:22 ` unlvsur at live dot com
2021-12-01  4:51 ` unlvsur at live dot com
2021-12-01  8:29 ` redi at gcc dot gnu.org
2021-12-01  8:37 ` redi at gcc dot gnu.org
2022-01-05 22:06 ` cvs-commit at gcc dot gnu.org
2022-01-05 22:06 ` cvs-commit at gcc dot gnu.org
2022-01-05 22:10 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103453-4-SavJ5U6ezX@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).