From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC9F43858D3C; Wed, 28 Jun 2023 09:41:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC9F43858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687945299; bh=td4ezihUJrgGbd+z6tcPoAuR4WoVbR/nC+pV8Z31epE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Df6asoDiB1DzoqZN1RCCJIbvIlzlloKrgPALfRd4zYmgTd64QUnoAdkolG8Z9gHc1 638IziBT3G8zplZD+Lc1M7w9wYZkLmKeW/FgcjdvYhXS0mXwLkeH9+suRSMB4/9z2+ TrxQ7YevnPOBWhBE7tRfD+qL8IbjThRbY/KJMx5U= From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/110433] ASAN reports mismatching new/delete when compiling analyzer testcases Date: Wed, 28 Jun 2023 09:41:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110433 --- Comment #2 from Martin Jambor --- Here is the promised longer trace (from compiling testsuite/gcc.dg/analyzer/out-of-bounds-diagram-5-unicode.c): =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D58010=3D=3DERROR: AddressSanitizer: new-delete-type-mismatch on 0x50d= 000000a00 in thread T0: object passed to delete has wrong type: size of the allocated type: 136 bytes; size of the deallocated type: 104 bytes. #0 0x83eba8 in operator delete(void*, unsigned long) /home/worker/buildworker/tiber-gcc-asan/build/libsanitizer/asan/asan_new_de= lete.cpp:164 #1 0x51e6e45 in std::default_delete::operator()(ana::svalue_spati= al_item*) const /home/worker/buildworker/tiber-gcc-asan/objdir/prev-x86_64-pc-linux-gnu/lib= stdc++-v3/include/bits/unique_ptr.h:99 #2 0x51e6e45 in std::unique_ptr >::~unique_ptr() /home/worker/buildworker/tiber-gcc-asan/objdir/prev-x86_64-pc-linux-gnu/lib= stdc++-v3/include/bits/unique_ptr.h:404 #3 0x51e6e45 in ana::access_diagram_impl::~access_diagram_impl() /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/access-diagram.c= c:1728 #4 0x51e703c in ana::access_diagram_impl::~access_diagram_impl() /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/access-diagram.c= c:1728 #5 0x4e97142 in std::default_delete::operator()(text_art::widget*) const /home/worker/buildworker/tiber-gcc-asan/objdir/prev-x86_64-pc-linux-gnu/lib= stdc++-v3/include/bits/unique_ptr.h:99 #6 0x4e97142 in std::unique_ptr >::~unique_ptr() /home/worker/buildworker/tiber-gcc-asan/objdir/prev-x86_64-pc-linux-gnu/lib= stdc++-v3/include/bits/unique_ptr.h:404 #7 0x4e97142 in text_art::wrapper_widget::~wrapper_widget() /home/worker/buildworker/tiber-gcc-asan/build/gcc/text-art/widget.h:136 #8 0x4e97142 in ana::access_diagram::~access_diagram() /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/access-diagram.h= :149 #9 0x4e97142 in ana::out_of_bounds::make_access_diagram(ana::access_operation const&, text_art::style_manager&, text_art::theme const&, ana::logger*) const /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/bounds-checking.= cc:192 #10 0x4e97142 in ana::out_of_bounds::maybe_show_diagram(ana::logger*) c= onst /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/bounds-checking.= cc:169 #11 0x4e9928c in ana::out_of_bounds::maybe_show_notes(unsigned int, ana::logger*) const /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/bounds-checking.= cc:125 #12 0x4e9928c in ana::concrete_buffer_overflow::emit(rich_location*, ana::logger*) /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/bounds-checking.= cc:333 #13 0x4eee9ed in ana::diagnostic_manager::emit_saved_diagnostic(ana::exploded_graph const&, ana::saved_diagnostic const&) /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/diagnostic-manag= er.cc:1424 #14 0x4efca7a in ana::dedupe_winners::emit_best(ana::diagnostic_manager= *, ana::exploded_graph const&) /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/diagnostic-manag= er.cc:1311 #15 0x4eefd35 in ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph const&) /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/diagnostic-manag= er.cc:1363 #16 0x2a647b6 in ana::impl_run_checkers(ana::logger*) /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/engine.cc:6139 #17 0x2a66f59 in ana::run_checkers() /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/engine.cc:6213 #18 0x2a2f8dc in execute /home/worker/buildworker/tiber-gcc-asan/build/gcc/analyzer/analyzer-pass.cc= :87 #19 0x197af8b in execute_one_pass(opt_pass*) /home/worker/buildworker/tiber-gcc-asan/build/gcc/passes.cc:2651 #20 0x197d6d0 in execute_ipa_pass_list(opt_pass*) /home/worker/buildworker/tiber-gcc-asan/build/gcc/passes.cc:3100 #21 0xd6f193 in ipa_passes /home/worker/buildworker/tiber-gcc-asan/build/gcc/cgraphunit.cc:2268 #22 0xd6f193 in symbol_table::compile() /home/worker/buildworker/tiber-gcc-asan/build/gcc/cgraphunit.cc:2331 #23 0xd6f193 in symbol_table::compile() /home/worker/buildworker/tiber-gcc-asan/build/gcc/cgraphunit.cc:2309 #24 0xd76f09 in symbol_table::finalize_compilation_unit() /home/worker/buildworker/tiber-gcc-asan/build/gcc/cgraphunit.cc:2583 #25 0x1d81ed8 in compile_file /home/worker/buildworker/tiber-gcc-asan/build/gcc/toplev.cc:471 #26 0x77e8fb in do_compile /home/worker/buildworker/tiber-gcc-asan/build/gcc/toplev.cc:2126 #27 0x77e8fb in toplev::main(int, char**) /home/worker/buildworker/tiber-gcc-asan/build/gcc/toplev.cc:2282 #28 0x789813 in main /home/worker/buildworker/tiber-gcc-asan/build/gcc/main.cc:39=