public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/106301] New: RFE: analyzer support of mmap
@ 2022-07-14 15:03 dmalcolm at gcc dot gnu.org
  2022-07-14 15:06 ` [Bug analyzer/106301] " dmalcolm at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-07-14 15:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106301
           Summary: RFE: analyzer support of mmap
           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
            Blocks: 106003
  Target Milestone: ---

Now that the analyzer can track uses of file-descriptors, we may want to
special-case mmap:
  https://www.man7.org/linux/man-pages/man2/mmap.2.html

  void *mmap(void *addr, size_t length, int prot, int flags,
             int fd, off_t offset);

If (flags & MAP_ANONYMOUS) is false, then "fd" is required to be an open file
descriptor (and the access direction must match that expressed by "prot").

If (flags & MAP_ANONYMOUS) is true, then some implementations require "fd" to
be -1.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106003
[Bug 106003] RFE: -fanalyzer could complain about misuse of file-descriptors

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

* [Bug analyzer/106301] RFE: analyzer support of mmap
  2022-07-14 15:03 [Bug analyzer/106301] New: RFE: analyzer support of mmap dmalcolm at gcc dot gnu.org
@ 2022-07-14 15:06 ` dmalcolm at gcc dot gnu.org
  2022-07-14 19:34 ` egallager at gcc dot gnu.org
  2022-11-15 19:11 ` dmalcolm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-07-14 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Potentially we could also track the allocated region, and complain if it is
leaked.  I think this would require handling of mmap/munmap in sm-malloc.cc (so
that we can detect leaks), and support in the region-model code for
memory-mapped regions (for aliasing support)

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

* [Bug analyzer/106301] RFE: analyzer support of mmap
  2022-07-14 15:03 [Bug analyzer/106301] New: RFE: analyzer support of mmap dmalcolm at gcc dot gnu.org
  2022-07-14 15:06 ` [Bug analyzer/106301] " dmalcolm at gcc dot gnu.org
@ 2022-07-14 19:34 ` egallager at gcc dot gnu.org
  2022-11-15 19:11 ` dmalcolm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: egallager at gcc dot gnu.org @ 2022-07-14 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
mmap has some portability issues to be aware of:
https://www.gnu.org/software/gnulib/manual/html_node/mmap.html
(besides the ones listed there, another one I've come across is sometimes some
headers shortening their name for MAP_ANONYMOUS to just MAP_ANON)

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

* [Bug analyzer/106301] RFE: analyzer support of mmap
  2022-07-14 15:03 [Bug analyzer/106301] New: RFE: analyzer support of mmap dmalcolm at gcc dot gnu.org
  2022-07-14 15:06 ` [Bug analyzer/106301] " dmalcolm at gcc dot gnu.org
  2022-07-14 19:34 ` egallager at gcc dot gnu.org
@ 2022-11-15 19:11 ` dmalcolm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-11-15 19:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106301
Bug 106301 depends on bug 106302, which changed state.

Bug 106302 Summary: RFE: provide a way for -fanalyzer to use target flags
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106302

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

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

end of thread, other threads:[~2022-11-15 19:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 15:03 [Bug analyzer/106301] New: RFE: analyzer support of mmap dmalcolm at gcc dot gnu.org
2022-07-14 15:06 ` [Bug analyzer/106301] " dmalcolm at gcc dot gnu.org
2022-07-14 19:34 ` egallager at gcc dot gnu.org
2022-11-15 19:11 ` 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).