From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4A9413857403; Tue, 15 Jun 2021 16:22:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A9413857403 From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/101081] New: analyzer testsuite failures seen with new glibc due to malloc attribute Date: Tue, 15 Jun 2021 16:22:36 +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: 12.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: Tue, 15 Jun 2021 16:22:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101081 Bug ID: 101081 Summary: analyzer testsuite failures seen with new glibc due to malloc attribute Product: gcc Version: 12.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: --- Fedora's build of GCC showed some new analyzer failures: +FAIL: gcc.dg/analyzer/analyzer-verbosity-2a.c (test for excess errors) +FAIL: gcc.dg/analyzer/analyzer-verbosity-3a.c (test for excess errors) +FAIL: gcc.dg/analyzer/edges-1.c (test for excess errors) +FAIL: gcc.dg/analyzer/file-1.c (test for excess errors) +FAIL: gcc.dg/analyzer/file-2.c (test for excess errors) +FAIL: gcc.dg/analyzer/file-paths-1.c (test for excess errors) +FAIL: gcc.dg/analyzer/file-pr58237.c (test for excess errors) +FAIL: gcc.dg/analyzer/pr99716-1.c (test for excess errors) which appeared between: gcc/11.1.1/3.fc35: glibc-2.33.9000-2.fc35.x86_64 gcc/11.1.1/4.fc35: glibc-2.33.9000-13.fc35.x86_64=20=20=20=20 These testcases all use Almost all of these seem to be due to new -Wanalyzer-malloc-leak warnings, where the testcases are expecting to emit -Wanalyzer-file-leak (from sm-file.cc), but are now *also* emitting -Wanalyzer-malloc-leak. Presumably the new glibc gained __attribute__((malloc)) within stdio.h. As well as these, pr99716-1.c adds these excess errors: =20=20=20 /builddir/build/BUILD/gcc-11.1.1-20210531/gcc/testsuite/gcc.dg/analyzer/pr9= 9716-1.c:11:5: warning: use of possibly-NULL 'fp' where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument] =20=20=20 /builddir/build/BUILD/gcc-11.1.1-20210531/gcc/testsuite/gcc.dg/analyzer/pr9= 9716-1.c:23:5: warning: use of possibly-NULL 'fp' where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument] =20=20=20 /builddir/build/BUILD/gcc-11.1.1-20210531/gcc/testsuite/gcc.dg/analyzer/pr9= 9716-1.c:36:5: warning: use of possibly-NULL '*fpp' where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument] which look like genuine warnings: passing unchecked ptrs to fprintf. Looks like: (a) these testcases should avoid and instead have their own copy = of the decls, to avoid from changing under us (b) the malloc attribute gave us some genuine warnings, so it's valuable; t= he analyzer should do something to support this, but it's probably overkill to emit *both* -Wanalyzer-malloc-leak and -Wanalyzer-file-leak.=