From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 317AA385781B; Fri, 2 Apr 2021 22:15:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 317AA385781B From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/99886] New: Infinite loop in -fanalyzer seen on gcc.dg/analyzer/malloc-1.c with -fanalyzer-verbosity=0 Date: Fri, 02 Apr 2021 22:15:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2021 22:15:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99886 Bug ID: 99886 Summary: Infinite loop in -fanalyzer seen on gcc.dg/analyzer/malloc-1.c with -fanalyzer-verbosity=3D0 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: dmalcolm at gcc dot gnu.org Target Milestone: --- Reproducer: #include struct coord { float x; float y; }; void test_34 (void) { float *q; struct coord *p =3D malloc (sizeof (struct coord)); if (!p) return; p->x =3D 0.0f; q =3D &p->x; free (p); *q =3D 1.0f; /* { dg-warning "use after 'free' of 'q'" } */ }; when compiled with: -fanalyzer -fanalyzer-verbosity=3D0 Doesn't happen at other verbosity levels. Seems to be getting stuck here in diagnostic_manager::consolidate_condition= s: (gdb) bt #0 0x00000000024a8777 in vec::length (this=3D0x7fffffffca98) at ../../src/gcc/vec.h:1439 #1 0x00000000024c0d30 in ana::checker_path::num_events (this=3D0x7fffffffc= a90) at ../../src/gcc/analyzer/checker-path.h:503 #2 0x00000000024c0138 in ana::diagnostic_manager::consolidate_conditions (this=3D0x7fffffffcf00, path=3D0x7fffffffca90) at ../../src/gcc/analyzer/diagnostic-manager.cc:2203 #3 0x00000000024bf433 in ana::diagnostic_manager::prune_path (this=3D0x7fffffffcf00, path=3D0x7fffffffca90, sm=3D0x0, sval=3D0x0, state= =3D0x0) at ../../src/gcc/analyzer/diagnostic-manager.cc:1783 #4 0x00000000024be1b6 in ana::diagnostic_manager::emit_saved_diagnostic (this=3D0x7fffffffcf00, eg=3D..., sd=3D...) at ../../src/gcc/analyzer/diagnostic-manager.cc:1131 #5 0x00000000024c1af1 in ana::dedupe_winners::emit_best (this=3D0x7fffffff= cc20, dm=3D0x7fffffffcf00, eg=3D...) at ../../src/gcc/analyzer/diagnostic-manager.cc:1051 #6 0x00000000024bdfa6 in ana::diagnostic_manager::emit_saved_diagnostics (this=3D0x7fffffffcf00, eg=3D...) at ../../src/gcc/analyzer/diagnostic-manager.cc:1100 #7 0x0000000001830e13 in ana::impl_run_checkers (logger=3D0x35ccbf0) at ../../src/gcc/analyzer/engine.cc:4892=