On Thu, 2012-03-29 at 18:18 +0100, Daniele Varrazzo wrote:
Hello David,
We have released psycopg 2.4.5
<
http://initd.org/psycopg/articles/2012/03/29/psycopg-245-released/>
which, apart from a few bug fixes reported by the users, has had the
entire code base cleaned up using the static checker.
That's great news!
I haven't managed to run it without false positive, which was
probably
too high as a target. Some reference counts are not going to be set to
zero, just because they are not: it is the case of static variables,
for instance we use the python string "NULL" over and over in the
library so we just keep a reference to it.
Yes - I don't think zero false
positives is feasible at this time, but
I'm glad that the tool has been of help.
Anyway, the checker has allowed me to clean up 47 distinct
occurrences
of missing checks for errors on return values (thus likely to segfault
downstream due to null dereferencing), 14 refcount errors (mostly
related to global objects initializations, so not live memory leak)
and four wrong function arguments check, three of which exposed to
python and leading to a segfault if the wrong object was used. I'm
happy it hasn't found any major disaster, our codebase wasn't that
bad, but it's great it has made the module more robust in the face of
the unexpected (that is, in case of memory error it won't be our
module to segfault hiding the real cause of the memory error).
So, thank you very much for the tool and the assistance in using it.
I'll look forward to try and contribute something else to your
project.
You're welcome, and thanks for using it: you are exactly the target user
I have in mind for gcc-with-cpychecker, and your feedback has been very
helpful.
I've taken the liberty of adding psycopg to the plugin's "Success
Stories" list here:
http://gcc-python-plugin.readthedocs.org/en/latest/success.html#id2
Hope that's OK with you.
Dave