[issue5504] ctypes should work with systems where mmap can't be PROT_WRITE and PROT_EXEC

2009-03-17 Thread Adam Goode

New submission from Adam Goode :

On Fedora systems, it is invalid to mmap something with PROT_WRITE and
PROT_EXEC. libffi has been updated to support this, but ctypes has not
been updated to use this new functionality.

Attached is a patch which currently only works if system libffi is used.
Though the embedded version of libffi is new enough, it is missing the
allocation and free functions. I know how I would update the ctypes
libffi/ directory (add the alloc/free files), but not sure about the
other libffi directories (darwin, arm_wince, msvc, osx). I suppose those
would all need to be upgraded, or perhaps even made to use the standard
libffi instead of special forks of it.

Note that this also eliminates the malloc_closure code.

--
assignee: theller
components: ctypes
files: ctypes-newffi.patch
keywords: patch
messages: 83734
nosy: agoode, theller
severity: normal
status: open
title: ctypes should work with systems where mmap can't be PROT_WRITE and 
PROT_EXEC
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file13363/ctypes-newffi.patch

___
Python tracker 
<http://bugs.python.org/issue5504>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3265] Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error: `MAP_ANONYMOUS' undeclared

2009-03-17 Thread Adam Goode

Adam Goode  added the comment:

Issue #5504 shows a possibly more future proof way to fix this issue.

--
nosy: +agoode

___
Python tracker 
<http://bugs.python.org/issue3265>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5504] ctypes should work with systems where mmap can't be PROT_WRITE and PROT_EXEC

2009-05-04 Thread Adam Goode

Adam Goode  added the comment:

Currently there is an issue where allow_execstack implies allow_execmem.
Even though allow_execmem is default to off, allow_execstack is default
to on. If this issue is fixed, or if the administrator sets
allow_execstack to off, ctypes will fail.

Try this as root, then repeat your test:
semanage boolean -m --off allow_execstack

--

___
Python tracker 
<http://bugs.python.org/issue5504>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com