public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-101081-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            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    

These testcases all use <stdio.h>

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:

   
/builddir/build/BUILD/gcc-11.1.1-20210531/gcc/testsuite/gcc.dg/analyzer/pr99716-1.c:11:5:
warning: use of possibly-NULL 'fp' where non-null expected [CWE-690]
[-Wanalyzer-possible-null-argument]
   
/builddir/build/BUILD/gcc-11.1.1-20210531/gcc/testsuite/gcc.dg/analyzer/pr99716-1.c:23:5:
warning: use of possibly-NULL 'fp' where non-null expected [CWE-690]
[-Wanalyzer-possible-null-argument]
   
/builddir/build/BUILD/gcc-11.1.1-20210531/gcc/testsuite/gcc.dg/analyzer/pr99716-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 <stdio.h> and instead have their own copy of
the decls, to avoid <stdio.h> from changing under us
(b) the malloc attribute gave us some genuine warnings, so it's valuable; the
analyzer should do something to support this, but it's probably overkill to
emit *both* -Wanalyzer-malloc-leak and -Wanalyzer-file-leak.

             reply	other threads:[~2021-06-15 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 16:22 dmalcolm at gcc dot gnu.org [this message]
2021-06-15 16:24 ` [Bug analyzer/101081] " dmalcolm at gcc dot gnu.org
2022-02-04 16:44 ` joel at teichroeb dot net
2022-02-09  2:37 ` cvs-commit at gcc dot gnu.org
2022-02-09  2:39 ` dmalcolm at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101081-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).