Author vstinner
Recipients amaury.forgeotdarc, christian.heimes, georg.brandl, kristjan.jonsson, ncoghlan, serhiy.storchaka, vstinner
Date 2013-06-15.01:35:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1371260121.31.0.0137280201618.issue18203@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, initial patches are attached. Let describe them a little bit.

- pymem_debugcheckgil-2.patch: I don't think that this patch can be commited before the "bootstrap" issue is solved (Python doesn't start in debug mode with this patch when -W or -X command line option is used). I wrote it to check that other patches are correct (check if the GIL is held when PyMem_Malloc is called).

- py_finalize.patch: should be safe

- malloc_init.patch: change _Py_char2wchar() API, the result must now be freed by PyMem_RawFree() instead of PyMem_Free(). the change does not hurt in release mode (both functions are just wrapper to free()), but may break in debug mode (because python checks that PyMem_RawFree() is called on a buffer allocated by PyMem_RawMalloc()) in extension modules using _Py_char2wchar(). I would like to _Py_char2wchar() API (not to solve this issue, just because it is very useful for applications embedding Python), so changing its name would avoid a crash (applications would get a compilation or link error instead). Other change of the patch: replace free() and PyMem_Free() with PyMem_RawFree(), should be safe.

- malloc_modules.patch: I replaced many malloc() with PyMem_Malloc(), which is not safe.

All these patches must be reviewed carefully to check if the GIL is held or not, and tested with pymem_debugcheckgil-2.patch (on Windows too! some patched functions os posixmodule.c are only compiled on Windows).
History
Date User Action Args
2013-06-15 01:35:21vstinnersetrecipients: + vstinner, georg.brandl, amaury.forgeotdarc, ncoghlan, kristjan.jonsson, christian.heimes, serhiy.storchaka
2013-06-15 01:35:21vstinnersetmessageid: <1371260121.31.0.0137280201618.issue18203@psf.upfronthosting.co.za>
2013-06-15 01:35:21vstinnerlinkissue18203 messages
2013-06-15 01:35:20vstinnercreate