public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/105102] New: RFE: analyzer handling for asprintf and vasprintf
@ 2022-03-29 20:09 dmalcolm at gcc dot gnu.org
  2024-01-08 19:04 ` [Bug analyzer/105102] " dmalcolm at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-03-29 20:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105102
           Summary: RFE: analyzer handling for asprintf and vasprintf
           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: ---

(spotted while fixing PR analyzer/105087)

We don't yet have any special-casing of asprintf and vasprintf, and there
doesn't seem to be a way to express their behavior with attributes.

Would be nice to bifurcate state, and:
- on success, track that *ARG is to be freed with free (and thus we can detect
memory leaks, wrong deallocator, etc),
- on failure, *ARG is undefined; exactly what we should do here is unclear
(what exactly does glibc do?  https://linux.die.net/man/3/vasprintf says that
the "FreeBSD implementation sets strp to NULL on error.", presumably it means
*strp; ee PR 44435).

Maybe we need a new kind of poisoned_svalue "undefined" for the error case,
since there's no guarantee made about what the state of *ARG is?

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

* [Bug analyzer/105102] RFE: analyzer handling for asprintf and vasprintf
  2022-03-29 20:09 [Bug analyzer/105102] New: RFE: analyzer handling for asprintf and vasprintf dmalcolm at gcc dot gnu.org
@ 2024-01-08 19:04 ` dmalcolm at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-01-08 19:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
See also bug 113277

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

end of thread, other threads:[~2024-01-08 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 20:09 [Bug analyzer/105102] New: RFE: analyzer handling for asprintf and vasprintf dmalcolm at gcc dot gnu.org
2024-01-08 19:04 ` [Bug analyzer/105102] " 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).