Bug 794989 - Bugs found in libpwquality-1.0.0-2.fc17 using gcc-with-cpychecker static analyzer
Bugs found in libpwquality-1.0.0-2.fc17 using gcc-with-cpychecker static anal...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: libpwquality (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tomas Mraz
Fedora Extras Quality Assurance
http://fedorapeople.org/~dmalcolm/gcc...
:
Depends On:
Blocks: cpychecker
  Show dependency treegraph
 
Reported: 2012-02-18 10:10 EST by Dave Malcolm
Modified: 2012-06-27 23:54 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-27 23:54:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dave Malcolm 2012-02-18 10:10:47 EST
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
libpwquality-1.0.0-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-02-18/libpwquality-1.0.0-2.fc17/

I've manually reviewed the issues reported by the tool.

Within the category "Reference leaks" the 1 issues reported:
  pwquality.c:pwqerror:ob_refcnt of '*py_errvalue' is 1 too high
appears to be a true bug: the tuple associated with the AttributeError still has another reference within the scope of pwqerror, and so will become immortal for the lifetime of the process.

Within the category "Possible reference leaks" the 2 issues reported
 pwquality.c:pwqsettings_setint:ob_refcnt of new ref from (unknown) pwqerror is 1 too high
 pwquality.c:pwqsettings_setstr:ob_refcnt of new ref from (unknown) pwqerror is 1 too high
may well be false positives: the checker doesn't know whether or not pwquality_set_int_value and pwquality_set_str_value "steal" the reference they're passed (taking ownership), or merely borrow it.  If the latter, then these are also reference leaks.

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):
libpwquality-1.0.0-2.fc17
gcc-python-plugin post-0.9 git 771455b3128b1323e80bdda53939d8d140a84c68 running the checker in an *f16* chroot
Comment 1 Tomas Mraz 2012-05-23 11:58:54 EDT
Fixed in upstream hg repository, thanks for the report.
Comment 2 Fedora Update System 2012-06-01 04:15:53 EDT
libpwquality-1.1.0-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/FEDORA-2012-8576/libpwquality-1.1.0-1.fc17
Comment 3 Fedora Update System 2012-06-11 20:25:44 EDT
Package libpwquality-1.1.0-2.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libpwquality-1.1.0-2.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-8576/libpwquality-1.1.0-2.fc17
then log in and leave karma (feedback).
Comment 4 Fedora Update System 2012-06-14 20:28:24 EDT
Package libpwquality-1.1.1-1.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libpwquality-1.1.1-1.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-8576/libpwquality-1.1.1-1.fc17
then log in and leave karma (feedback).
Comment 5 Fedora Update System 2012-06-27 23:54:33 EDT
libpwquality-1.1.1-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

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