From Fedora Project Wiki
No edit summary
 
Line 1: Line 1:
{{admon/important | 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}}
{{admon/note | All sections of this template are required for review by FESCo.  If any sections are empty it will not be reviewed }}
<!-- All fields on this form are required to be accepted by FESCo.
<!-- All fields on this form are required to be accepted by FESCo.
  We also request that you maintain the same order of sections so that all of the feature pages are uniform.  -->
  We also request that you maintain the same order of sections so that all of the feature pages are uniform.  -->
Line 22: Line 17:


== Current status ==
== Current status ==
(this is just an idea at this point)
{{admon/note | This is just an idea at this point }}
* Targeted release: [[Releases/<number> | Fedora <number> ]]  
* Targeted release: [[Releases/<number> | Fedora <number> ]]  
* Last updated: (DATE)
* Last updated: (DATE)
Line 40: Line 35:


We may want to only do this for a subset of libraries e.g. the ones that are high-value for PyPy (e.g. database connectivity).
We may want to only do this for a subset of libraries e.g. the ones that are high-value for PyPy (e.g. database connectivity).
Potentially this could benefit other language runtimes that support similar FFI behavior.


== Benefit to Fedora ==
== Benefit to Fedora ==

Latest revision as of 17:40, 15 August 2011


Type-safe "ctypes"

Summary

Owner

  • Email: <dmalcolm@redhat.com>

Current status

Note.png
This is just an idea at this point
  • Targeted release: [[Releases/<number> | Fedora <number> ]]
  • Last updated: (DATE)
  • Percentage of completion: XX%


Detailed Description

ctypes is a Python module that allows Python code to make arbitrary function calls into C libraries.

Unfortunately, such Python code needs to provide its own view of the layout of C-level type information, and if this is not in-sync with the actual C code, it it likely to segfault the python process.

The underlying libraries are built with the necessary information, for use by debugging tools, in "DWARF" format, but we strip this out and place it into "debuginfo" packages, since it is large.

The idea is to investigate if we can only strip part of the debuginfo, keeping the type information as part of the main library (assuming this doesn't get too large), and to then patch python, python3 and pypy to take account of this.

We may want to only do this for a subset of libraries e.g. the ones that are high-value for PyPy (e.g. database connectivity).

Potentially this could benefit other language runtimes that support similar FFI behavior.

Benefit to Fedora

This is (potentially) a distribution-wide change that would greatly improve the platform for use by PyPy, and thus Fedora would be an even better platform for PyPy usage.


Scope

TODO:

  • investigate sizes of the various parts of debuginfo across the various packages in the distro
  • potentially come up with some subset that are worth targeting
  • change the DWARF-stripping behavior to retain the information we need
  • patch libffi to check type information, and to extract it (for the case where no type information is provided by the caller)
  • patch ctypes within python and python3 to use the libffi new features, raising TypeError, or similar, if the types don't match correctly
  • patch pypy to cover the same ground
  • ensure that all of the various DWARF-handling programs can cope with the new division; in particular, gdb
  • test!

How To Test

User Experience

Dependencies

Contingency Plan

Documentation

Release Notes

Comments and Discussion