Kristján Valur Jónsson added the comment:
Perhaps in debug builds the memory apis should verify consistency and matching
useage.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16742
___
STINNER Victor added the comment:
Kristján Valur Jónsson added the comment:
Perhaps in debug builds the memory apis should verify consistency and
matching useage.
Python does check usage of apis in debug mode. Memory allocation failure
are almost never checked. See my pyfailmalloc module for
Roundup Robot added the comment:
New changeset 6c9050ad1afc by Victor Stinner in branch 'default':
Issue #16742: My fix on PyOS_StdioReadline() was incomplete, PyMem_FREE() was
http://hg.python.org/cpython/rev/6c9050ad1afc
--
___
Python tracker
Roundup Robot added the comment:
New changeset 98dbe677dfe7 by Victor Stinner in branch 'default':
Close #16742: Fix misuse of memory allocations in PyOS_Readline()
http://hg.python.org/cpython/rev/98dbe677dfe7
--
nosy: +python-dev
resolution: - fixed
stage: needs patch -
Changes by STINNER Victor victor.stin...@gmail.com:
--
dependencies: +API for setting the memory allocator used by Python
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16742
___
STINNER Victor added the comment:
Updated patch for the final API of #3329. Update also the documentation.
PyOS_ReadlineFunctionPointer must now use PyMem_RawMalloc() or
PyMem_RawRealloc(), instead of PyMem_Malloc() or PyMem_Realloc().
--
Added file:
STINNER Victor added the comment:
I just found the readline/GIL issue while working on #18203. I created #18205
but then I found this issue. I just closed #18205 as a duplicate. Here is a
patch for Python 3.4.
--
Copy of the initial message (msg191089):
The callback
STINNER Victor added the comment:
See the following thread on python-dev, the root problem is that PyMem_Malloc()
cannot be called with the GIL held. This is a bug in my opinion, and it should
be fixed.
http://mail.python.org/pipermail/python-dev/2013-June/126822.html
--
Kristján Valur Jónsson added the comment:
My quick and dirty fix is simple:
_PyOS_ReadlineTState = PyThreadState_GET();
/* CCP change, cannot release the GIL here because PyOS_StdioReadline uses
* the regular MALLOC
*/
/*
Py_BEGIN_ALLOW_THREADS
*/
#ifdef
Antoine Pitrou added the comment:
So, could you propose a patch?
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16742
___
___
Changes by Meador Inge mead...@gmail.com:
--
nosy: +meador.inge
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16742
___
___
Python-bugs-list
Changes by Kristján Valur Jónsson krist...@ccpgames.com:
--
nosy: +kristjan.jonsson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16742
___
___
Changes by Gregory P. Smith g...@krypto.org:
--
nosy: +gregory.p.smith
priority: normal - critical
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16742
___
New submission from Trent Nelson:
Relevant thread:
http://mail.python.org/pipermail/python-dev/2012-December/123225.html
PyOS_StdioReadline features numerous calls that require the GIL to be held.
Ideally, the GIL drop-take should be moved closer to the actual underlying read
system call.
14 matches
Mail list logo