On Wed, 2020-01-08 at 04:02 -0500, David Malcolm wrote: > Jeff reviewed the v1 version of this patch here: > https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00507.html > > I note this seems somewhat incomplete -- which is fine given my > > recommendation was to focus on the double-free analyzer. The biggest > > question is do we want to include this in the first iteration? Perhaps > > as an example that others can flesh out to capture the missing stuff > > (like operations on released FD or file pointers?) > > > > The similarities with double-free, use-after-free are significant. But > > I hesitate to suggest trying to generaize and merge them at this point. > > The failures here are likely to be in terms of false negatives rather > than false positives, as it shares so much infrastructure with > sm-malloc.cc (there are enough differences though that trying to merging > feels like more pain that it's worth). > > I have some followups on the branch that fix some of these. > > Or we can leave this out of the initial release if need be. > Or disable it by default, and require the user to opt-in using > -fanalyzer-checker=file (though that would complicate the docs). > > Changed in v5: > - update ChangeLog path > - updated copyright years to include 2020 > > Changed in v4: > - Remove include of gcc-plugin.h, reworking includes accordingly. > - Wrap everything in #if ENABLE_ANALYZER > - Remove /// comment lines > - Rework on_leak vfunc: > https://gcc.gnu.org/ml/gcc-patches/2019-11/msg02028.html > - Rework for changes to is_named_call_p, resolving function pointers: > https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00178.html > > This patch adds a state machine checker for stdio's FILE stream API. > > gcc/analyzer/ChangeLog: > * sm-file.cc: New file. I think we ought to go ahead and include it. No need for someone who wants to write/finish a FILE */FD analyzer to have to recreate what you've already done.
jeff >