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

            Bug ID: 86229
           Summary: ASAN Reports "alloc-dealloc mismatch" intsead of
                    "attempted delete without new"
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mitranopeter at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

Created attachment 44298
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44298&action=edit
preprocessed file

GCC version: 8.0.1 20180311
System Type: Ubuntu 16.04
GCC Build options: defaults
Compile command: g++ -std=c++11 -fsanitize=address main.cpp

First time reporting here, so forgive me if this out of scope of wontfix. ASAN
gives me different (true) error messages depending on some very strange small
changes to my code. 

I either get (1)

    alloc-dealloc-mismatch (INVALID vs operator delete)

Or (2)

    attempting free on address which was not malloc()-ed:

In the attached preprocessed file, you should see error (1) which isn't very
helpful. What's super weird is that if I make my struct have less than three
ints, or if I remove the iostream business, I get (2) which I believe to be a
much more useful error message.

If I could attach more than one file I'd give you both *.cpp files to
demonstrate, but hopefully this is clear as is.

Reply via email to