On Tue, Feb 28, 2012 at 7:35 PM, David Malcolm <dmalcolm(a)redhat.com> wrote:
Hi David,
A higher-level caution: please be careful not to place too much trust
in
the checker! Remember that this is only alpha-quality software. I
expect there to be plenty of bugs in the checker.
If you find yourself having to make too many changes to the code to
satisfy the checker, it may be that the checker is getting it wrong, or
that the checker simply can't cope with the pattern of code that it's
seeing. The checker only analyzes each function individually: it has no
"whole program" knowledge, it merely tries to verify some heuristics
about the typical behaviors of individual functions within a CPython
extension.
It's possible to write perfectly correct CPython extensions that cause
the checker to emit numerous false warnings: a good example here would
be functions that return borrowed references, rather than new
references. In the automated analysis runs I've been doing, any time I
see a "perfect" result from the checker, it turns out to be a bug :(
(usually there was issue with the build flags, and the checker didn't
get run).
So I'd be wary about trying to achieve 100% perfection from the checker
at this point. Sorry if this comes across as negative, but when I read
about "worsening the code" to satisfy the checker, I have mixed
emotions: the checker is intended to serve you, not the other way
around. I don't want to create extra work for you: the idea is to make
it easier to identify genuine bugs, so that they can be fixed.
You absolutely don't need to justify for the result your program is
obtaining, or is not (yet). I understand this is a work in progress
and don't expect to run flawlessly or to be absolutely complete or
correct. I just want to give you a feedback on using it on a different
codebase than the one you are likely testing it, and get more use
cases. The "worsening the code" is about trying to get the limit of
the insight the plugin ends up gathering the code, and I propose you
as a direction of a way the plugin can be improved: you may have not
meet such use cases in the code you have tested for.
So, I'm happy if the plugin can help me improving the quality of the
library I maintain, but also if I can provide some feedback (maybe
patches, eventually) to improve the plugin itself. We both know the
limit of the email as a medium, and don't think there is any
incomprehension about the scope of your project.
Which is cool!
Thank you for all the improvements: the new attribute, the subtype
check and the suggestion about how to work around the tracebacks: I
had't had time today to work on it but tomorrow will implement all the
suggested changes and keep on testing.
Cheers,
-- Daniele