public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/98575] [11 regression] False -Wanalyzer-malloc-leak on code path involving unknown function call
Date: Tue, 09 Feb 2021 20:55:00 +0000	[thread overview]
Message-ID: <bug-98575-4-S6fMb0vmnE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98575-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 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:790a8e8942b3f5a896ab5897cd209de1d9c382ae

commit r11-7156-g790a8e8942b3f5a896ab5897cd209de1d9c382ae
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Feb 9 15:54:14 2021 -0500

    analyzer: support "_IO_"-prefixed variants of FILE * fns [PR98575]

    PR analyzer/98575 describes an unexpected -Wanalyzer-malloc-leak false
    positive from gcc.dg/analyzer/pr94851-1.c on glibc < 2.28.

    The issue is that a getchar call gets inlined into a call to _IO_getc,
    and "_IO_getc" is not in the set of FILE * functions the analyzer
    "knows about".  This exposes a bug in memory leak detection on code
    paths in which an unknown function has been called.

    The memory leak bug is fixed in the prior commit, but for good
    measure this patch special-cases the "_IO_"-prefixed names in glibc
    so that the analyzer can reuse its knowledge about the unprefixed
    variants.

    gcc/analyzer/ChangeLog:
            PR analyzer/98575
            * sm-file.cc (is_file_using_fn_p): Support "_IO_"-prefixed
            variants.

    gcc/testsuite/ChangeLog:
            PR analyzer/98575
            * gcc.dg/analyzer/file-1.c (test_5): New.
            * gcc.dg/analyzer/file-3.c: New test.

  parent reply	other threads:[~2021-02-09 20:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 19:54 [Bug testsuite/98575] New: [11 regression] gcc.dg/analyzer/pr94851-1.c fails after r11-6495 seurer at gcc dot gnu.org
2021-01-07  8:27 ` [Bug analyzer/98575] " rguenth at gcc dot gnu.org
2021-02-04 19:38 ` dmalcolm at gcc dot gnu.org
2021-02-04 23:02 ` dmalcolm at gcc dot gnu.org
2021-02-04 23:16 ` dmalcolm at gcc dot gnu.org
2021-02-04 23:48 ` dmalcolm at gcc dot gnu.org
2021-02-09 20:53 ` [Bug analyzer/98575] [11 regression] False -Wanalyzer-malloc-leak on code path involving unknown function call cvs-commit at gcc dot gnu.org
2021-02-09 20:55 ` cvs-commit at gcc dot gnu.org [this message]
2021-02-09 21:05 ` 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-98575-4-S6fMb0vmnE@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).