Bug 795011
Summary: | Possible segfaults under low memory conditions found in postgresql-9.1.2-2.fc17 using gcc-with-cpychecker static analyzer | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dave Malcolm <dmalcolm> |
Component: | postgresql | Assignee: | Tom Lane <tgl> |
Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | devrim, hhorak, tgl |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-02-18/postgresql-9.1.2-2.fc17/ | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-03-13 19:33:24 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 789472 |
Description
Dave Malcolm
2012-02-18 16:20:34 UTC
(In reply to comment #0) Thanks Dave, this is interesting stuff. I don't hack plpython much myself, but I'll point some other upstream people to this report. > Within the category "Segfaults in normal paths" the 1 issue reported is a > false-positive (assuming that lineno>=0): the checker has no way of knowing > that lineno>=0, and detects that s is still NULL for the case where lineno < 0. Actually the case where it would fail is lineno == 0. Since the code is troubling to check for bad lineno at all, it seems like it ought to return NULL for that case as well; so I'd call this a real bug, even though it might not currently be exercisable depending on what the calling logic is. Have you considered running this tool over code unrelated to Python? This particular bit of analysis doesn't seem at all Python-specific. (In reply to comment #1) > (In reply to comment #0) > > Thanks Dave, this is interesting stuff. I don't hack plpython much myself, but > I'll point some other upstream people to this report. Thanks. > > Within the category "Segfaults in normal paths" the 1 issue reported is a > > false-positive (assuming that lineno>=0): the checker has no way of knowing > > that lineno>=0, and detects that s is still NULL for the case where lineno < 0. > > Actually the case where it would fail is lineno == 0. Since the code is You're right; I misread the report. > Have you considered running this tool over code unrelated to Python? This > particular bit of analysis doesn't seem at all Python-specific. Yes, I'd like to do this eventually, but I'm restricting the scope for now to just Python C extensions, to keep me sane. Upstream fixes for these issues have been committed at http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=0cb4a0bfb80c7d75c745faf3597bed5c3f9a3c49 None of them seem critical enough to justify making a Fedora patch; I'll just wait to incorporate the next upstream minor release, which will likely be in a couple of months. BTW, the people who looked at this commented that quite a few of the false positives were because the tool doesn't know that PLy_elog(ERROR, ...) does not return. Not sure that it's worth trying to teach the tool about that, because it's a mighty project-specific thing, and not very cleanly defined (whether it returns or not depends on the error-severity argument :-(). But just thought I'd mention it. |