From Fedora Project Wiki
(initial page creation from template)
 
Line 11: Line 11:
<!-- The actual name of your feature page should look something like: Features/YourFeatureName.  This keeps all features in the same namespace -->
<!-- The actual name of your feature page should look something like: Features/YourFeatureName.  This keeps all features in the same namespace -->


= Feature Name <!-- The name of your feature --> =
= Static Analysis of CPython Extensions <!-- The name of your feature --> =


== Summary ==
== Summary ==
<!-- A sentence or two summarizing what this feature is and what it will do.  This information is used for the overall feature summary page for each release. -->
<!-- A sentence or two summarizing what this feature is and what it will do.  This information is used for the overall feature summary page for each release. -->
I'm working on a static analysis tool that can detect common mistakes made in Python extension modules written in C.  We'll run it on all such code in Fedora, fixing any problems we find, and send the patches to the appropriate upstream projects.


== Owner ==
== Owner ==
<!--This should link to your home wiki page so we know who you are-->
<!--This should link to your home wiki page so we know who you are-->
* Name: [[User:FASAcountName| Your Name]]
* Name: [[User:dmalcolm| Dave Malcolm]]


<!-- Include you email address that you can be reached should people want to contact you about helping with your feature, status is requested, or  technical issues need to be resolved-->
<!-- Include you email address that you can be reached should people want to contact you about helping with your feature, status is requested, or  technical issues need to be resolved-->
* Email: <your email address so we can contact you, invite you to meetings, etc.>
* Email: dmalcolm@redhat.com


== Current status ==
== Current status ==
* Targeted release: [[Releases/<number> | Fedora <number> ]]  
* Targeted release: [[Releases/<number> | Fedora <number> ]]  
* Last updated: (DATE)
* Last updated: 2011-04-25
* Percentage of completion: XX%
* Percentage of completion: 5%


<!-- CHANGE THE "FedoraVersion" TEMPLATES ABOVE TO PLAIN NUMBERS WHEN YOU COMPLETE YOUR PAGE. -->
<!-- CHANGE THE "FedoraVersion" TEMPLATES ABOVE TO PLAIN NUMBERS WHEN YOU COMPLETE YOUR PAGE. -->
Line 32: Line 33:
== Detailed Description ==
== Detailed Description ==
<!-- Expand on the summary, if appropriate.  A couple sentences suffices to explain the goal, but the more details you can provide the better. -->
<!-- Expand on the summary, if appropriate.  A couple sentences suffices to explain the goal, but the more details you can provide the better. -->
Python makes it relatively easy to write wrapper code for C and C++ libraries, acting as a "glue" layer to bind.
Unfortunately, there are various mistakes that are commonly made in such wrapper code, and these mistakes can lead to /usr/bin/python leaking memory, segfaulting, or failing when run on less common CPU architectures.
I'm working on static analysis code for C, to detect common errors in C extension modules for Python.  The plan is to integrate this with Fedora's packaging, so that all C extension modules packaged for Python 2 and Python 3 can be guaranteed free of such errors (by adding hooks to the python-devel and python3-devel).  We can also send fixes for this code as needed to upstream projects, when it reports problems.  (Naturally this assumes a good signal:noise ratio from the tool).


== Benefit to Fedora ==
== Benefit to Fedora ==
<!-- What is the benefit to the platform?  If this is a major capability update, what has changed?  If this is a new feature, what capabilities does it bring? Why will Fedora become a better distribution or project because of this feature?-->
<!-- What is the benefit to the platform?  If this is a major capability update, what has changed?  If this is a new feature, what capabilities does it bring? Why will Fedora become a better distribution or project because of this feature?-->
Fedora is already a great environment for doing Python development - having a good-quality static analysis tool integrated into Fedora's build system for python extension modules will make Fedora even more compelling for Python developers.
The presence of the tool should also make it easier to fix certain awkward bugs, and make it easier to support secondary CPU architectures.


== Scope ==
== Scope ==
<!-- What work do the developers have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->
<!-- What work do the developers have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->
This involves:
* writing the tool
* tuning it to achieve a good signal:noise ratio:
** testing it on a large number of different extension modules
** analyzing the issues that it reports; fixing bugs in the
* itegrating it into the python 2 and python 3 build of Fedora RPMs (python-devel and python3-devel)


== How To Test ==
== How To Test ==

Revision as of 19:25, 25 April 2011

Important.png
Comments and Explanations
The page source contains comments providing guidance to fill out each section. They are invisible when viewing this page. To read it, choose the "edit" link.
Copy the source to a new page before making changes! DO NOT EDIT THIS TEMPLATE FOR YOUR FEATURE.
Important.png
Set a Page Watch
Make sure you click watch on your new page so that you are notified of changes to it by others, including the Feature Wrangler
Note.png
All sections of this template are required for review by FESCo. If any sections are empty it will not be reviewed



Static Analysis of CPython Extensions

Summary

I'm working on a static analysis tool that can detect common mistakes made in Python extension modules written in C. We'll run it on all such code in Fedora, fixing any problems we find, and send the patches to the appropriate upstream projects.

Owner

  • Email: dmalcolm@redhat.com

Current status

  • Targeted release: [[Releases/<number> | Fedora <number> ]]
  • Last updated: 2011-04-25
  • Percentage of completion: 5%


Detailed Description

Python makes it relatively easy to write wrapper code for C and C++ libraries, acting as a "glue" layer to bind.

Unfortunately, there are various mistakes that are commonly made in such wrapper code, and these mistakes can lead to /usr/bin/python leaking memory, segfaulting, or failing when run on less common CPU architectures.

I'm working on static analysis code for C, to detect common errors in C extension modules for Python. The plan is to integrate this with Fedora's packaging, so that all C extension modules packaged for Python 2 and Python 3 can be guaranteed free of such errors (by adding hooks to the python-devel and python3-devel). We can also send fixes for this code as needed to upstream projects, when it reports problems. (Naturally this assumes a good signal:noise ratio from the tool).

Benefit to Fedora

Fedora is already a great environment for doing Python development - having a good-quality static analysis tool integrated into Fedora's build system for python extension modules will make Fedora even more compelling for Python developers.

The presence of the tool should also make it easier to fix certain awkward bugs, and make it easier to support secondary CPU architectures.

Scope

This involves:

  • writing the tool
  • tuning it to achieve a good signal:noise ratio:
    • testing it on a large number of different extension modules
    • analyzing the issues that it reports; fixing bugs in the
  • itegrating it into the python 2 and python 3 build of Fedora RPMs (python-devel and python3-devel)


How To Test

User Experience

Dependencies

Contingency Plan

Documentation

Release Notes

Comments and Discussion