public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/101081] New: analyzer testsuite failures seen with new glibc due to malloc attribute
@ 2021-06-15 16:22 dmalcolm at gcc dot gnu.org
  2021-06-15 16:24 ` [Bug analyzer/101081] " dmalcolm at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-06-15 16:22 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug analyzer/101081] analyzer testsuite failures seen with new glibc due to malloc attribute
  2021-06-15 16:22 [Bug analyzer/101081] New: analyzer testsuite failures seen with new glibc due to malloc attribute dmalcolm at gcc dot gnu.org
@ 2021-06-15 16:24 ` dmalcolm at gcc dot gnu.org
  2022-02-04 16:44 ` joel at teichroeb dot net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-06-15 16:24 UTC (permalink / raw)
  To: gcc-bugs

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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-06-15
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug analyzer/101081] analyzer testsuite failures seen with new glibc due to malloc attribute
  2021-06-15 16:22 [Bug analyzer/101081] New: analyzer testsuite failures seen with new glibc due to malloc attribute dmalcolm at gcc dot gnu.org
  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
  3 siblings, 0 replies; 5+ messages in thread
From: joel at teichroeb dot net @ 2022-02-04 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

Joel Teichroeb <joel at teichroeb dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joel at teichroeb dot net

--- Comment #1 from Joel Teichroeb <joel at teichroeb dot net> ---
I've submitted a patch to the mailing list which fixes this issue.

https://gcc.gnu.org/pipermail/gcc-patches/2022-February/589886.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug analyzer/101081] analyzer testsuite failures seen with new glibc due to malloc attribute
  2021-06-15 16:22 [Bug analyzer/101081] New: analyzer testsuite failures seen with new glibc due to malloc attribute dmalcolm at gcc dot gnu.org
  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
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-09  2:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:

https://gcc.gnu.org/g:e52a683170877d140eebc9782731eaf11897db71

commit r12-7119-ge52a683170877d140eebc9782731eaf11897db71
Author: Joel Teichroeb <joel@teichroeb.net>
Date:   Fri Feb 4 11:35:08 2022 -0500

    analyzer: Fix tests for glibc 2.35 [PR101081]

    In recent versions of glibc fopen has __attribute__((malloc)).
    Since we can not detect wether this attribute is present or not,
    we avoid including stdio.h and instead forward declare what we
    need in each test.

    Signed-off-by: Joel Teichroeb <joel@teichroeb.net>

    gcc/testsuite/ChangeLog:
            PR analyzer/101081
            * gcc.dg/analyzer/analyzer-verbosity-2a.c: Replace #include of
            stdio.h with declarations needed by the test.
            * gcc.dg/analyzer/analyzer-verbosity-3a.c: Likewise.
            * gcc.dg/analyzer/edges-1.c: Likewise.
            * gcc.dg/analyzer/file-1.c: Likewise.
            * gcc.dg/analyzer/file-2.c: Likewise.
            * gcc.dg/analyzer/file-paths-1.c: Likewise.
            * gcc.dg/analyzer/file-pr58237.c: Likewise.
            * gcc.dg/analyzer/pr99716-1.c: Likewise.

    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug analyzer/101081] analyzer testsuite failures seen with new glibc due to malloc attribute
  2021-06-15 16:22 [Bug analyzer/101081] New: analyzer testsuite failures seen with new glibc due to malloc attribute dmalcolm at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-02-09  2:37 ` cvs-commit at gcc dot gnu.org
@ 2022-02-09  2:39 ` dmalcolm at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-02-09  2:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks.  The above patch fixes part (a) of comment #0, but I'm not yet sure
what to do about part (b), so keeping this bug report open for now.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-09  2:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 16:22 [Bug analyzer/101081] New: analyzer testsuite failures seen with new glibc due to malloc attribute dmalcolm at gcc dot gnu.org
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

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).