public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/99687] New: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x604000000d50
Date: Sat, 20 Mar 2021 19:56:14 +0000	[thread overview]
Message-ID: <bug-99687-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 99687
           Summary: AddressSanitizer: alloc-dealloc-mismatch (malloc vs
                    operator delete) on 0x604000000d50
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: nathan at gcc dot gnu.org
            Blocks: 86656
  Target Milestone: ---

I noticed this issue:

$ ./xg++ -B.
/home/marxin/Programming/gcc2/gcc/testsuite/g++.dg/modules/keyword-1_a.C -c
-std=c++17  -fmodules-ts
=================================================================
==26209==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator
delete) on 0x604000000d50
    #0 0x7ffff7674f47 in operator delete(void*, unsigned long)
(/usr/lib64/libasan.so.6+0xb3f47)
    #1 0xf4cfd6 in fini_modules()
/home/marxin/Programming/gcc2/gcc/cp/module.cc:20012
    #2 0xda5f20 in c_parse_final_cleanups()
/home/marxin/Programming/gcc2/gcc/cp/decl2.c:5239
    #3 0x1493a37 in c_common_parse_file()
/home/marxin/Programming/gcc2/gcc/c-family/c-opts.c:1240
    #4 0x27a4946 in compile_file /home/marxin/Programming/gcc2/gcc/toplev.c:457
    #5 0x27add07 in do_compile /home/marxin/Programming/gcc2/gcc/toplev.c:2201
    #6 0x27ae56b in toplev::main(int, char**)
/home/marxin/Programming/gcc2/gcc/toplev.c:2340
    #7 0x5179dcb in main /home/marxin/Programming/gcc2/gcc/main.c:39
    #8 0x7ffff7095b24 in __libc_start_main ../csu/libc-start.c:332
    #9 0xab9c1d in _start
(/home/marxin/Programming/gcc2/objdir/gcc/cc1plus+0xab9c1d)

0x604000000d50 is located 0 bytes inside of 40-byte region
[0x604000000d50,0x604000000d78)
allocated by thread T0 here:
    #0 0x7ffff767295f in __interceptor_malloc (/usr/lib64/libasan.so.6+0xb195f)
    #1 0x53c4a47 in xrealloc
/home/marxin/Programming/gcc2/libiberty/xmalloc.c:177
    #2 0xf64061 in void va_heap::reserve<binding_slot>(vec<binding_slot,
va_heap, vl_embed>*&, unsigned int, bool)
/home/marxin/Programming/gcc2/gcc/vec.h:290
    #3 0xf5ac8d in bool vec_safe_reserve<binding_slot,
va_heap>(vec<binding_slot, va_heap, vl_embed>*&, unsigned int, bool)
/home/marxin/Programming/gcc2/gcc/vec.h:698
    #4 0xf4bbc0 in init_modules(cpp_reader*)
/home/marxin/Programming/gcc2/gcc/cp/module.cc:19779
    #5 0xce903a in cxx_init_decl_processing()
/home/marxin/Programming/gcc2/gcc/cp/decl.c:4708
    #6 0xe42537 in cxx_init() /home/marxin/Programming/gcc2/gcc/cp/lex.c:330
    #7 0x27ac419 in lang_dependent_init
/home/marxin/Programming/gcc2/gcc/toplev.c:1889
    #8 0x27adc03 in do_compile /home/marxin/Programming/gcc2/gcc/toplev.c:2186
    #9 0x27ae56b in toplev::main(int, char**)
/home/marxin/Programming/gcc2/gcc/toplev.c:2340
    #10 0x5179dcb in main /home/marxin/Programming/gcc2/gcc/main.c:39
    #11 0x7ffff7095b24 in __libc_start_main ../csu/libc-start.c:332

SUMMARY: AddressSanitizer: alloc-dealloc-mismatch
(/usr/lib64/libasan.so.6+0xb3f47) in operator delete(void*, unsigned long)
==26209==HINT: if you don't care about these errors you may set
ASAN_OPTIONS=alloc_dealloc_mismatch=0
==26209==ABORTING


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86656
[Bug 86656] [meta-bug] Issues found with -fsanitize=address

             reply	other threads:[~2021-03-20 19:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20 19:56 marxin at gcc dot gnu.org [this message]
2021-03-20 19:56 ` [Bug c++/99687] " marxin at gcc dot gnu.org
2021-03-20 19:56 ` marxin at gcc dot gnu.org
2021-03-20 19:58 ` marxin at gcc dot gnu.org
2021-03-22 12:01 ` cvs-commit at gcc dot gnu.org
2021-03-22 12:01 ` marxin 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-99687-4@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).