(→Scope) |
No edit summary |
||
Line 1: | Line 1: | ||
<!-- 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 == | ||
{{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
- Name: Dave Malcolm
- Email: <dmalcolm@redhat.com>
Current status
- 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!