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

            Bug ID: 63299
           Summary: ASan reported alloc-dealloc-mismatch in
                    g++.old-deja/g++.jason/init3.C
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chefmax at gcc dot gnu.org
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 33513
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33513&action=edit
This trivial patch seems to fix the issue.

ASan reported alloc-dealloc-mismatch in g++.old-deja/g++.jason/init3.C:

$ ~/install/master/bin/g++  gcc/testsuite/g++.old-deja/g++.jason/init3.C
-fsanitize=address

=================================================================
==26627==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs
operator delete) on 0x60200000ef70
    #0 0x7fca6b2ca6a9 in operator delete(void*)
/home/max/workspace/downloads/gcc/libsanitizer/asan/asan_new_delete.cc:85
    #1 0x4015d1 in My_string::~My_string()
(/home/max/workspace/downloads/gcc/a.out+0x4015d1)
    #2 0x4013e6 in main (/home/max/workspace/downloads/gcc/a.out+0x4013e6)
    #3 0x7fca6a67c76c in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2176c)
    #4 0x400d98 (/home/max/workspace/downloads/gcc/a.out+0x400d98)

0x60200000ef70 is located 0 bytes inside of 13-byte region
[0x60200000ef70,0x60200000ef7d)
allocated by thread T0 here:
    #0 0x7fca6b2ca2b9 in operator new[](unsigned long)
/home/max/workspace/downloads/gcc/libsanitizer/asan/asan_new_delete.cc:55
    #1 0x40118d in My_string::My_string(My_string const&)
(/home/max/workspace/downloads/gcc/a.out+0x40118d)
    #2 0x4013b8 in main (/home/max/workspace/downloads/gcc/a.out+0x4013b8)
    #3 0x7fca6a67c76c in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2176c)

SUMMARY: AddressSanitizer: alloc-dealloc-mismatch
/home/max/workspace/downloads/gcc/libsanitizer/asan/asan_new_delete.cc:85
operator delete(void*)
==26627==HINT: if you don't care about these warnings you may set
ASAN_OPTIONS=alloc_dealloc_mismatch=0
==26627==ABORTING

Reply via email to