Bug 1286733
Summary: | Invalid Python PMAPI pmRegisterDerived call crashes libpcp | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Marko Myllynen <myllynen> | ||||
Component: | pcp | Assignee: | Nathan Scott <nathans> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 23 | CC: | brolley, fche, lberk, mgoodwin, nathans, pcp, scox | ||||
Target Milestone: | --- | Keywords: | Reopened | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | pcp-3.10.9-1.fc23 pcp-3.10.9-1.fc22 pcp-3.11.1-1.el5 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2016-04-06 14:55:32 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
I would argue that a python program shouldn't be able to crash libpcp anyway. If it can, the python bindings do not perform sufficient checking. See also https://bugzilla.redhat.com/show_bug.cgi?id=1262721#c5 Hi Marko, (In reply to Marko Myllynen from comment #0) > Created attachment 1100522 [details] > pmapi-test.py > > Description of problem: > The attached test script exposes two issues around Python PMAPI > pmRegisterDerived(): > > localhost:~> python ~/pmapi-test.py > zsh: segmentation fault python ~/pmapi-test.py The crash happens because to the ctypes wrapper declares pmRegisterDerived(3) with an integer return type, when it actually returns a string. > localhost:~> python ~/pmapi-test.py > REGISTERED 1 > EXCEPTION 2 > 'NoneType' object has no attribute 'decode' > localhost:~> > With that fixed, I see the second behaviour above - the NoneType is coming from pmDerivedErrStr (not sure why, but this seems to always return NULL - might be something to do with the thread-local-storage used in libpcp for this error message string). But, even if we can't get at an error string, we should not be calling decode() on NoneType unconditionally as the python wrapper code is currently doing. Fixed upstream - will be in pcp-3.10.9. pcp-3.10.9-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-d08245c076 pcp-3.10.9-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-2b40815137 pcp-3.10.9-1.el5 has been submitted as an update to Fedora EPEL 5. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-2ac90519bc pcp-3.10.9-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update pcp' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-2b40815137 pcp-3.10.9-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update pcp' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-d08245c076 pcp-3.10.9-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'yum --enablerepo=epel-testing update pcp' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-2ac90519bc pcp-3.10.9-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report. pcp-3.10.9-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report. pcp-3.11.0-1.el5 has been submitted as an update to Fedora EPEL 5. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-57b7efb2d7 pcp-3.11.0-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-57b7efb2d7 pcp-3.11.1-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-5b519318e0 pcp-3.11.1-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report. |
Created attachment 1100522 [details] pmapi-test.py Description of problem: The attached test script exposes two issues around Python PMAPI pmRegisterDerived(): localhost:~> python ~/pmapi-test.py zsh: segmentation fault python ~/pmapi-test.py localhost:~> python ~/pmapi-test.py REGISTERED 1 EXCEPTION 2 'NoneType' object has no attribute 'decode' localhost:~> Version-Release number of selected component (if applicable): pcp-3.10.6-2.el7.x86_64