Bug 800138 - Bug found in python-cryptsetup-0.1.4-2.fc17 using gcc-with-cpychecker static analyzer
Summary: Bug found in python-cryptsetup-0.1.4-2.fc17 using gcc-with-cpychecker static ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cryptsetup
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Milan Broz
QA Contact: Fedora Extras Quality Assurance
URL: http://fedorapeople.org/~dmalcolm/gcc...
Whiteboard:
Depends On:
Blocks: cpychecker
TreeView+ depends on / blocked
 
Reported: 2012-03-05 20:04 UTC by Dave Malcolm
Modified: 2013-03-01 04:11 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-07-09 10:21:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Malcolm 2012-03-05 20:04:37 UTC
Description of problem:
I've been writing an experimental static analysis tool to detect bugs commonly occurring within C Python extension modules:
  https://fedorahosted.org/gcc-python-plugin/
  http://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html
  http://fedoraproject.org/wiki/Features/StaticAnalysisOfPythonRefcounts

I ran the latest version of the tool (in git master; post 0.9) on
python-cryptsetup-0.1.4-2.fc17.src.rpm, and it reports various errors.

You can see a list of errors here, triaged into categories (from most significant to least significant):
http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-03-05/python-cryptsetup-0.1.4-2.fc17/

I've manually reviewed the issue reported by the tool:
pycryptsetup/cryptsetup.c:passwordDialog:ob_refcnt of '*result' is 1 too high

This appears to be a reference leak for the case where PyArg_Parse fails (if the callback returns a value that isn't a string): it's missing a Py_DECREF(result) on that path.

There may of course be other bugs in my checker tool.

Hope this is helpful; let me know if you need help reading the logs that the tool generates - I know that it could use some improvement.

Version-Release number of selected component (if applicable):
python-cryptsetup-0.1.4-2.fc17
gcc-python-plugin post-0.9 git 11462291a66c8db693c8884cb84b795bb5988ffb running the checker in an *f16* chroot

Comment 1 Milan Broz 2012-04-03 17:09:21 UTC
Dave, python-cryptsetup module moved to cryptsetup package and upstream is now submodule of cryptsetup itself (rpm is build as subrpm as well)

It was renamed to cryptsetup-python though. See
http://koji.fedoraproject.org/koji/buildinfo?buildID=284146

Can you try to run against version there? I think I fixed a lot of problems there already.

Comment 2 Milan Broz 2012-07-09 10:21:23 UTC
I think this was fixed in python module merge to cryptsetup.
If not, please reopen and provide logs for new version (see comment #1), thanks.


Note You need to log in before you can comment on or make changes to this bug.